JavaFX from the Trenches – Part 1 – Native Packaging

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.

Native Packaging

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.

Being MAC illiterate, you can imagine what appeal the Self Contained Application Packaging option held for me.

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.

This entry was posted in Evidentia, JavaFX. Bookmark the permalink.

3 Responses to JavaFX from the Trenches – Part 1 – Native Packaging

  1. Pingback: Java desktop links of the week, December 24 | Jonathan Giles

  2. Werner Lehmann says:

    Thanks for taking the time to write this down. I recognized a few things from the time when I experimented with the self-contained installers. It went smoother for me though, using WiX on windows I had quick success.

    Show stopper was the requirement to repeat the steps on Mac for a Mac installer – this was a small application with only two users, one on Windows, one on Mac. Although we have a MacBook around for mac testing, it is in no way included on the build server. This would mean to duplicate the build server on a Mac. Not going to happen anytime soon. So I went with a good old zip and no bundled JRE.

    In the end it took maybe a day to get to this, and the (Windows) experience with the installer stuff was ok, so far not using any installer customizations. I would absolutely recommend to read the documentation carefully though 🙂

    Also, thanks for looking into app store requirements. The ensemble demo makes it look easy but apparently it is not.

  3. TPC says:

    Thanks for sharing your experiences. May this will help us to reduce our deployment time.

Leave a Reply

Your email address will not be published. Required fields are marked *