I would like to know about the various options for distributing a Java application.
I know that you can
- Distribute the Source Code and let users compile it themselves, or provide make files, etc..
- Package it into a JAR, and have self extracting archives
- and (I’m sure, myriad other ways)
I’m hoping for some explanations about the most common options (and one’s I haven’t thought of) and in particular, do they require a user to have a JVM, or can it be bundled with one – personally I’m not too fond of an installer which halts due to a lack of JVM. Who says an app needs an installer, stand-alone solutions are fine too.
Also, worth asking is how to handle cross-platform distributing, exe’s vs dmg’s, etc…
My primary motivation for this question (which I appreciate is similar to others) is to find solutions that don’t require the user to already have a JVM installed – but for completeness, I’m asking generally.
Thanks very much
This is probably ok for open source projects, but very unusual for anything commercial. I’d recommend providing it as an option for the techies, but distributing JARs also
I’d call this the best practice
How about making the jar executable instead?
I don’t think it’s legal to bundle JREs.That said, it’s rather obvious that a java-based solution won’t work without Java. OpenOffice and many others fail to install without an installed JRE. I’d say that’s understandable and OK.IzPack seems to be a good solution to create Java-based installers.
As I wrote,
I think it’s not legal to bundle the JRE[UPDATE: it is legal, read this document for reference] (and also not a good option, as you’d have to bundle many different OS / architecture combinations). So the only other way would be native compilation (can’t help you with that, sorry).