How to bundle Java application for Mac/Windows?

pathikrit picture pathikrit · May 23, 2012 · Viewed 8.2k times · Source

I have a Java .jar application that I want to distribute to my clients who are on Macs or Windows. I want to use a tool that takes my jar file and wraps it in a .dmg and a .exe wrapper for Macs and Windows respectively that does this when run:

  1. Checks if JRE is installed; if not, it installs JRE6 from Oracle. Else, it updates installed JRE to latest 1.6.x version.
  2. Creates a short cut link in Start Menu (in Windows) or the Applications folder (in MacOSX) to my wrapped application and lets my application to run using the above JRE
  3. Supports easy "uninstall application" for Windows. For Mac, simply drag the .app to Trash to delete.

Optional features:

  1. Support for platform independent app icons
  2. Support for auto updates to the jar
  3. Support for arguments to the JRE when running my .jar
  4. Linux support (.deb or .rpm)

Answer

jahroy picture jahroy · May 23, 2012

Check out Package Maker for Mac and Advanced Installer for Windows.

I've used them both for just about every requirement you've listed.

I haven't used them for auto-updates, but you probably have to build that logic into your app.

Don't expect them to do ALL of the work for you, though.

Expect to spend quite a bit of time building an installer for each platform.

I'm sure there are lots of options for Windows and Linux. Advanced Installer just happens to be the only one I've used.

I believe Package Maker is the standard for Mac. It's pretty awesome and easy to use.

Good luck!