简体   繁体   中英

What packaging tool should I use for a Mac/Windows Java app?

I have a Java desktop app that runs on both the MacOS and Windows.

I understand that I cannot have one distribution for each, which is not a requirement.

I need to know what tool or tools is best to use when delivering a Java app for each.

The tool should install prerequisites (in this case, Java and some JARs) and look native to the respective operating system.

As for OS X's java situation:

  1. Currently, JDK 6 is bundled in the OS.
  2. Presumably, the next version of the OS will still include JDK 6.
  3. It's publicly stated that the OS will have a well-defined place to install multiple copies of Java runtimes, a public interface choosing which of the Java version, etc. See here .
  4. Apple started contributing back its own code to the open JDK community, so JDK 7 should be available as a separate download, see here .
  5. So, you're not expected to include Java runtime itself into your Java app even then. You're not supposed to install Java in a ramdom place on a filesystem, for example.

As for how you should deploy java apps on OS X:

  1. Double-clicking jar just works.
  2. However, that won't be pretty, because you would only have a generic Java icon in the Dock. You don't want that.
  3. You should use Jar Bundler to make it an honest OS X app. On Mac, it comes with XCode. See the documentation here. You can do that on a non-Mac machine too, using this open-source project .

On Windows, I would recommend either JSmooth or WinRun4J .

On a Mac, the situation is a bit more complex (as the comments point out), but just distributing an executable JAR is probably good enough for now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM