example alternatives to java-based applications – etcher by resin.io

I’m back to finding alternatives to the use of Java. Oracle is working to increase license collections on Java big time starting this year. I loath Oracle and all things Oracle, and the fact they now own Java and have gone after licensing fees for Java means, for me, that I have come to loath Java equally. It is for this reason I’ve once again flip-flopped toward finding and using any and all alternatives to Java on every platform I work with. An excellent example of an alternative is the image burner application Etcher from resin.io.

Etcher ticks a number of key boxes for me:

  • It can safely copy a Linux image from an image file (iso, img, etc) to a USB drive or SDHC device.
  • It can work on Windows, Linux, or macOS. In this example I tested it on macOS Sierra.
  • It’s open source and available via github.
  • It’s based on Electron, using CSS, HTML, and JavaScript.
  • I can use it to copy my Raspberry Pi images to micro SDHC cards simply and reliably on my MBP.

That last bullet is what makes it a full keeper for me, as well as the tool I now point novices towards who want to work with the Raspberry Pi and want to create their own micro SDHC cards. It is absolutely as simple as starting the application, pointing it towards the image, and then plugging in the device to be flashed. Etcher finds the device automatically, making it dead simple to click the button and start the image copy to the device. No more tricky and down-right dangerous CLI dances with mount, umount, and dd.

Other Electron-based applications I now use are Atom, the editor, and Slack. There’s a whole bunch more out there, and the tooling to write even more is available where-ever there’s tooling for writing web applications. Java isn’t going to die anytime soon as it has a lock on a lot of legacy software. But that’s the same formidable block that Microsoft Windows posed back in the day, and we’ve seen where Microsoft is today, especially in mobile. Rather than complain about how bad Oracle and Java have become, my energy would be better spent promoting Electron and other foundational products and tools as better solutions than Java, even Java 8. It really is time to move on.

the duke is back, or i find i can’t do without java

1000px-wave-svgBack on 14 July I wrote a post titled “no more java“, in which I swore off the use of Java for everything new and to “walk away from any Java programming opportunity.”

It turns out that there is, practically speaking, no way for me to do that. As much as I despise Oracle, the use of the language throughout the last 21+ years of my software engineering career (Java officially turned 20 in 2015) isn’t something I can just blithely walk away from. As I came to discover over the last 60 days, while there are a lot of very good programming languages besides Java, there are some things for which Java is the better fit, warts and all.

That’s not to say I didn’t find the other languages I looked at as less than Java. I found them all quite compelling in their own rights. The languages I did go back and look into included Python, C-Ruby, JavaScript (via node.js), the latest stable version of C++ (C++14 via gcc and clang), Google Go (up to 1.7) , and Rust (up to 1.11). Notable by its absence is Swift. I chose not to dive into Swift because it’s still only on one platform (OS X, soon to be called macOS) and because it’s still in a state of flux as it transitions to Swift 3.

All those languages I did look deeply into were quite compelling in their own rights and offered powerful solutions for different classes of problems. And while they tended to overlap some features and capabilities of Java, they could never replace Java for the types of software problems I like to work on. And please note, when I speak of the languages I also speak of the development, build, test, and deployment tools that wrap a language and help make it a powerful problem solver.

I don’t consider my two months looking elsewhere a waste of time; far from it. It was an eye-opening trek into languages I would have never taken otherwise, as well as a deeper dive into some languages I’d had considerable experience with before, such as Python and Ruby (in fact, working with Python 3.5 was almost like re-learning the language, as the last version I’d touched was 2.4). With Java I’d grown a bit stale in my thinking, which is never a good thing. Looking at other programming languages fosters opportunities to expand perspectives and offers alternative solutions to tough problems for which Java might not be the best fit. It also illustrate ways to weave these “new-ish” solutions back into new and existing Java solutions.

And finally, by taking two months away from my Java work, I discovered when I came back that tough problems I couldn’t quite solve before were suddenly solvable, some of them quite easily so. I really needed a break away from Java.

So it’s back to Java, or more precisely, the Java Virtual Machine (JVM). For with the JVM I also have Scala, Groovy, Gradle, and JRuby, not just Java 8. I’m using the Actor pattern Futures and Promises and the Parallel Collections Library supported by Scala for modeling and simulation, while using Groovy and JRuby to solve unique problems while calling down into the Java libraries, especially for UI bits. And finally I’m getting the hang of using Gradle as my primary build, test, and deployment framework. I am so tired of Ant and I’m no fan of Maven either.

I need to do this again, at least once/year, to maintain a clear mindset and fresh perspective. I look forward to my next walk-about through the programming language landscape.

no more java

no-java
I have been a Java user and promoter since its initial release in 1995. I’ve lived through, and worked around, all the issues that’ve cropped up over the years, especially during the dismal period around Java 6, before Sun was purchased by Oracle. Since then Java 7, and now Java 8, have been released to address limitations, advance the language and try to fix security issues.

But no more. I have uninstalled Java on every computer and every VM I own. I don’t intend to write another line of Java, and I will walk away from any Java programming opportunity.

There’s a lot of reasons for me to take this stand, but the two that finally pushed me to do something are a security issue and Oracle itself. Let’s talk first about Oracle.

Oracle bought Sun and all its assets in 2010. Those assets included Java and a number of open source projects, such as Open Office and MySQL. Oracle’s stewardship of both was so bad that both were forked into LibreOffice and MariaDB, respectively. Fortunately, or unfortunately, Oracle managed to put just enough time, money, and energy into maintaining Java that it continued on to Java 7 and Java 8, with Java 9 just over the horizon. On the surface Oracle sounds like a responsible steward for Java.

But Oracle isn’t a responsible steward. Oracle doesn’t care about the language and its evolution as an open platform, only how much money it can make from the language itself. They underscored this with the multi-year lawsuit against Google over Google’s use of Java API’s in Android. I’m not fan of Android, but I appreciate how Google has prevailed against Oracle’s repeated lawsuits and appeals. They should have because Oracle’s suite is all about Oracle’s greed. If it were just a fight between two tech titans then it wouldn’t be that big a problem. Unfortunately for us all the problem with the entire legal process those two have been embroiled in is the disastrous decision issued on May 9, 2014, where the Federal Circuit found that the Java APIs are copyrightable. This is a blow to the very foundation of software innovation, and all because Oracle wanted a multi-billion payday out of Google for Google’s successful implementation of Java within Android. As software developers and innovators, we are now all at risk, and I will not work with a language or a vendor that has created that incredible risk. All that time and money Oracle poured into suing Google would have been far better served enhancing Java. But Google won’t do that because, as Ars Technica recently wrote, Java “isn’t currently printing money,” or enough to satisfy their overarching corporate greed.

The second reason is security related. Java, along with Flash, has been a cesspool of security vulnerabilities for years, vulnerabilities that Oracle has rather capriciously decided to fix (or not). On July 4th Heimdal posted a security alert about a Java-based zero-day exploit called Adwind that installed a RAT on any platform (Windows, Linux, OSX, and Android) that runs Java. That was the tipping point for me.

This exploit, along with Oracle’s behavior towards Java in general and Google in particular, convinced me to walk away from Java. That means: remove Java off of everything I own and to never write another line of Java. I will neither use nor purchase any Java-based tools either. No actoins to support Java.

From now on it’s any language but Java.

trying to build a better android application (part 1)

The circumference of Earth, in miles, which is the product of pi (3.1415926) times Earth’s diameter (7,918 miles).
Samsung Galaxy S4 running Android 5.0.2

Since sometime around 2011 I have dabbled with Android programming, starting with Android Honeycomb. My reasons for targeting Android 3.0 in were:

  1. Honeycomb was explicitly for tablets and I was very interested in the tablet form,
  2. Just about any device could become a developer target device without having to register with Google (unlike Apple),
  3. It had become “interesting” with its new additions in support of tablets,
  4. The Eclipse tooling seemed mature enough, and
  5. I had grandiose ambitions about writing the Next Great App.

That last point included the idle idea of making heaps of money, but that was quashed quickly and rather brutally by the harsh reality of the Android app marketplace.

That didn’t stop me from continuing to tinker with Android over the past few years. My hard drive is now littered with dozens and dozens of toy applications (toy in the sense that they were never launched into the marketplace). Then, one day quite recently, Google saw fit to update my two Nexus 7 2013 models with Android Lollipop 5.1 and 5.1.1 (and I have no idea why one is a point release higher than the other). I even have a Nexus 7 2012 with Lollipop 5.1.1, for all the good that older tablet can use it effectively. A Nexus 7 2012 with Android 5.1.1 is the very definition of molasses-in-January slow. A Nexus 7 2013 with Android 5.1/5.1.1 is at least usable.

Along the way to getting my Nexus 7s upgraded, AT&T upgraded my Samsung Galaxy S4 to their version of Lollipop 5.0.2. That’s what I’ll be using to test my app, rather than the larger Nexus 7 tablet. The S4’s size is about the same physical size as the HP32sII.

With the Nexus Lollipop updates came a built-in calculator app that I quickly came to loath. I don’t know who wrote it, but whomever it was has no concept of what a calculator truly is, especially regarding operational usability. Rather than merely complain about it I decided this was a golden opportunity to dig in and write my own, going by the old adage that if you think you can do better then do so.

Historical Background

I was an incoming electrical engineering freshman at Georgia Tech when the Ga Tech bookstore started to carry the Hewlett Packard HP-35 for $395. As a Georgia resident, that was about how much my tuition and books cost at the time. On my limited budget there was no way I could justify trading in my slide rule (yes, I had one of those) for the HP. But brother, I sure wanted one in the worst way.

The next spring after the HP-35 release I purchased the less expensive Texas Instruments SR-10 model 2 for $90. That lasted me for about two years until I upgraded to another wedge-shaped calculator, the SR-16. I loved those wedgies because they were built like bricks and took a lot of use and abuse. Two years after the SR-16 I advanced to the TI-58, followed rather quickly by the TI-59. After those TI models, when it came time to replace them due to heavy use, my calculator allegiance switched from TI to HP because TI had so cheapened their calculator construction in the interim. I still have working calculators from that period here at the house, but they’re an HP-16C (which I used for digital design work) and an HP-32sii (for general engineering). I have an old TI-95 Procalc I picked up at a heavy discount some point in the distant past. I bought it more for sentimental reasons at the time. It now sits in a drawer, totally unused.

The General Design

I decided to write my own calculator app, based on my experiences with both HP and TI. I did not set out to build an emulator of any particular model. What I wanted was something that fit the ethos of those calculators, especially the HP-67/HP-41C and TI-58/59 calculators. Those machines were their respective companies best of breed calculators. None before or since have quite measured up. It was one of my goals in writing my app to borrow from, but not slavishly re-create, their best ideas.

My app is based on the algebraic notation that TI also used, that is, typing in an arbitrary formula from left to right using parentheses for precedence control and ending the formula with the equals key. That’s why you’ll see those keys on my initial design. It’s a harder design as apposed to reverse Polish notation (RPN), the method used by HP. I won’t get pulled into the age-old argument as to which is better. I just decided for personal reasons to go with algebraic.

Preparatory

The application provided an opportunity to move up to writing idiomatic Lollipop applications using Google’s Material design rules. That meant moving from Eclipse to Android Studio. It also meant having to drop a lot of old coding practices. I’ve been using Android Studio since its beta releases, having created a series of (again) toy applications based on every type of starting template that Android Studio provides. For example my calculator was started with the Blank Activity template, an absolute minimal project, the Android equivalent to “Hello, World.”

I want to note that I will not be going through a step-by-step initial setup for this project. I will be talking about the issues of building this project, and what I’ve discovered along the way with using Android Studio v1.2 and Material Design, both good and bad, primarily good.

Current Functionality

The app can perform all four basic functions; add, subtract, multiple and divide. That means all the data entry keys (all numeric, decimal point), the change sign key, and the equals key work as expected. Clear (C) and clear entry (CE) keys work as expected. The Inverse (INV) and LNX (loge(x)) keys work. The keys that do not work are the Exponent Entry (EE) and the left and right parenthesis keys. You thus can’t perform full algebraic calculations nor can you enter a very large number in scientific notation, such as Avogadro’s number, 6.0221413 × 1023. I may implement that functionality while writing these posts, but that’s the current state of the app right now after several weeks of on-and-off work (mostly off).

What’s Next

The next entry in this series will begin with a general outline of the files in the application, how the app evolved from its initial creation until now, and the problems I encountered along the way with their solutions.

adding java and java-supported development tools to os x yosemite

I’ve been adding capabilities to my Mac Mini since powering it up the middle of this past week. After performing all the necessary OS updates, I installed Xcode 6.2.2. Xcode comes with a series of tools, one of which will be shown later in this article.Screen Shot 2015-01-23 at 8.01.20 PMThe installation of Xcode is important to the clean installation of two Java-based tools later on in this post, Android Studio and IntelliJ IDE 14.

System Specifics

  • Mac mini Server (Late 2012)
  • Processor 2.3 GHz Intel Core i7
  • Memory 4GB
  • Two, 2 TB HDD

Preconditions

  • Mac OS X Yosemite Version 10.10.1 (update free from App Store)
  • Mac Server 4.0.3 (update free from App Store)
  • Xcode 6.2.2 (installed free from App Store)
  • Apple’s Java (Java 6) is not installed

Software Installed

Installation of Latest Java

Download the latest version from the Oracle Technology Network. You should be able to find the latest under New Downloads in the upper right corner of the web page. For this example I’m installing the 64-bit Java 8 update 31 (jdk-8u31-macosx-x64.dmg). After download start the installation by clicking or double clicking, depending on where you find the dmg file, to launch the installer.
Screen Shot 2015-01-23 at 9.38.43 PMSimply follow the directions and double click the icon (the transparent yellow square in the open box) to start the installation of Java. The first screen presented to you will be an introduction. There’s very little there, so click through.
Screen Shot 2015-01-23 at 9.39.11 PMScreen Shot 2015-01-23 at 9.39.29 PM
Screen Shot 2015-01-23 at 9.39.42 PMWhen you click to install, it will ask you for your login account password, so type it in to continue.
Screen Shot 2015-01-23 at 9.40.16 PMThe installation is a simple progress bar. When it reaches the end all the software will be installed on your system. The last dialog is the summary with a close button. Once installed you can add a JAVA_HOME variable if you like with an “export JAVA_HOME=$(/usr/libexec/java_home)” in your .profile, but I don’t believe it’s necessary. You certainly don’t need to edit $PATH, as there are links to java, javac, and jar in /usr/bin.

You can, if you also wish, download from the Oracle site the Java 8 demo examples. They’re all in a zip file. Once unzipped you’ll find all the demo and example applications that were once bundled with Java. Also included in this collection are example JavaFX applications which are well work looking at. JavaFX is so much better for UI development than the older and much worse looking Swing.

Android Studio and IntelliJ 14 IDE Pre-Installation Preparation

The installation for both is very similar, which they should be, considering that Android Studio is based on IntelliJ IDE. For both download their respective dmg files, double click them to open them in Finder, then drag them into the Application folder. Once in the Application folder you need to make a change to their respective plist files. Find the applications in the Application folder, and right click on them. Select Show Package Contents from the menu.

Screen Shot 2015-01-23 at 10.57.57 PM

When the Contents folder appears, click through to the contents where info.plist is located. Double clock on info.plist.Screen Shot 2015-01-23 at 11.05.26 PMScreen Shot 2015-01-23 at 11.07.52 PMWhen Xcode opens up the plist (you did install Xcode, did you not?) open up JVMOptions, then select JVMVersion and clock on the string to edit it. The string, as shipped, is “1.6*”. Note the asterisk. If the string is left this way you will be prompted by both applications to install Apple’s much older Java 6. Changing the string to “1.6+”, with a “+” replacing “*”, tells the application to use the version of Java installed on the machine. Save this file and then double click the application to finish installation configuration.

For Android Studio I chose to download the separate Android SDK and install it (for my purposes) under $HOME/Java. The SDK comes as a zip file, so unzipping it under $HOME/Java produces $HOME/Java/android-sdk-macosx.

Installing Android Studio 1.0.1

With everything properly prepared, we’re ready to finish Android Studio’s installation (and IntelliJ if you’re so inclined). I’m only going to show Android Studio because it’s the more complex due to the Android SDK, but other than that they’re nearly identical.Screen Shot 2015-01-22 at 10.24.08 PMScreen Shot 2015-01-22 at 10.24.46 PMScreen Shot 2015-01-22 at 10.29.23 PMScreen Shot 2015-01-22 at 10.29.36 PMScreen Shot 2015-01-22 at 10.30.12 PMMake sure you open both top-level menu items and agree to their licensing.Screen Shot 2015-01-22 at 10.40.26 PMYou’ll go through several minutes (or longer) of watching Android Studio download any Android SDK files it thinks it needs. This is just a typical capture of this process, and towards the end.Screen Shot 2015-01-22 at 10.42.29 PMWe’re finally done!Screen Shot 2015-01-22 at 10.42.47 PMAnd ready to start development. The installation of IntelliJ is essentially the same but shorter. I’ll spare you the details.

Notes to The Gentle Reader

  • If you think this is overly complicated, it’s not. It’s no worse (and some might argue even simpler) than installation on Linux and Windows. The only obscure piece I had to go looking for was the plist adjustment. This information is missing on both Google’s Android Studio and Jetbrain’s IntelliJ IDEA websites. You’re welcome.
  • This is an initial install. I have no idea what will happen when I update Java, and I will update Java as each version is released. You update for the bug fixes. Failure to update any software is an invitation to grief, which is so easy to avoid. If any problems crop up when an update occurs then I’ll post an update about it here.