What’s the best way to distribute Java applications? [closed]

There are a variety of solutions, depending on your distribution requirements.

  1. Just use a jar. This assumes that the user has the the correct java version installed, otherwise the user will get “class-file format version” exceptions. This is fine for internal distribution inside a company.

  2. Use launch4j and an installer like NSIS. This gives you a lot more control, although the user can still do stupid stuff like un-installing the java runtime. This is probably the most popular approach, and what I currently use.

  3. Use Webstart. This also assumes that the user has the correct java version installed, but it’s a lot easier to get going. My experience is that this is fine for tightly controlled intranet environments, but becomes a pain with larger deployments because it has some many weird failures. It may get better with the new plug-in technology in Java 1.7.

  4. Use a native-code compiler like Excelsior JET and distribute as a executable, or wrap it up in an installer. Expensive, and it generally ties you to a slightly older version of java, and there is some pain with dynamic class-loading, but its very effective for large-scale deployment where you need to minimise your support hassles.

Leave a Comment