How to distribute a Java application

I would like to know about the various options for distributing a Java application.

I know you can

  • Distribute the source code and allow users to compile it themselves or provide make files, etc.
  • Pack it in a JAR and get self-extracting archives
  • and (I'm sure a myriad of other ways)

I hope for some explanations of the most common options (and one that I did not think about), and in particular, they require the user to have a JVM, or may be associated with one - m is not too keen on the installer, which stops due to lack of JVM. Who said the application needs an installer, standalone solutions are also great.

In addition, it is worth asking how to handle cross-platform distribution, exe vs dmg, etc.

My main motivation for this question (which, as I understand it, is similar to others) is to find solutions that do not require the user to already install the JVM, but for completeness, I ask in general.

Many thanks

+6
java cross-platform jar jvm distribution
source share
4 answers

Distribute the source code and let users compile it themselves or provide make files, etc.

This is probably normal for open source projects, but very unusual for any commercial. I would recommend providing it as an option for technicians, but distributing the JAR also

Insert it in a jar

I would call it best practice

and have self-extracting archives

How about making jar executable ?

I hope for some explanations of the most common options (and I didn’t think of one) and, in particular, they require the user to have a JVM, or may be bundled with one - I personally don’t really like the installer, which stops due to the lack of JVM .

I do not consider it legal to bind a JRE. However, it is pretty obvious that the Java solution will not work without Java. OpenOffice and many others cannot install without the JRE installed. I would say that this is understandable and good.

IzPack seems like a good solution for building Java-based installers.

My main motivation for this question (which I value similarly to others) is to find solutions that do not require a user to install an already installed JVM

As I wrote, I think it’s illogical to combine JRE [ UPDATE: it is legal, read this document for reference] (and also not a very good option, since you will have to combine many different OS / architecture combinations). Thus, the only way is to compile (I can not help you with this, sorry).

+5
source share

InstallBuilder makes it easy to distribute Java applications and bundle JVMs (although it does not require Java by itself, so as you mentioned, you'll never get errors because the end user does not have JVMs in the machine). This is a commercial product (diclaimer, I'm the original developer), but we have discounts for small independent developers and free licenses for open source projects. It is used by MySQL / Oracle, Jaspersoft, Alfresco, Pentaho and many other independent software developers based on Java tools, and these applications are downloaded literally millions of times without any serious problems. Try it :)

+3
source share

In general, you have several options:

1) Java Web Start 2) Run it as an applet 3) download and install. 

First of all, you are interested in option 3. You have many installers (InstallJammer is one, but you have others) for which you can create installation packages. Since you are looking at distributing the JVM (what you can do), you are looking at a different installer for each platform that you are targeting.

+1
source share

For simple products, I would like to get one executable jar. See http://one-jar.sourceforge.net/

For any large products and installer needed. (InstallAnywhere, Install4J, LzPack, etc. Will help you create it)

0
source share

All Articles