I recently released a commercial app (Evidentia) for the PC and MAC. That’s right, PC and MAC AT THE SAME TIME!
In my analysis of languages I code in, Java, and by extension JavaFX2, comes the closest to a true “write once, deploy anywhere” framework. However the process is NOT painless, and in this series of “from the Trenches” posts, I plan to document lessons learned in hopes that others may suffer less.
Let me start by saying that I am a fan of JavaFX2. Although Oracle will not come out and say that JavaFX2 is a replacement for Swing, well come on, someone should. OK I will – as far as I am concerned JavaFX2 is a replacement for Swing. When I looked ate frameworks, it eventually came down to Swing versus JavaFX2, and JavaFX2 won hands down.However, in this series I plan to be open, honest and direct including stating matter-of-factly st the start that JavaFX2, or more accurately 2.2, is not as stable as one would expect a 2.2 version to be.
More on that in future posts. On the the good parts! let’s start at the END.
My original plan had been to generate Java jar files and deploy a zip file as my production ready distribution – after all, everyone has Java loaded on their machine, right? Dumb idea. My target users are not uber geeks, and I couldn’t make those assumptions. Once I decided I was selling this product instead of open sourcing it, I had to up my game.
Enter Packaging for JavaFX - more specifically, Self Contained Application Packaging. With a few ant tasks added to my build file (and a few third party downloads), my app would be packaged 1) with the correct version of the Java libraries, and 2) in a traditional installation file format that would be recognized by most users, whether on the PC or the MAC.
The caveat? You have to build the Windows installer on a Windows machine, and the MAC installer on a MAC with a 64bit OS. This makes sense if you think about it, but I didn’t have a MAC. So a week before BETA testing was to start, I bought a used iMAC off Craigslist and started cramming.