Tom Marthenal
Tom Marthenal

Reputation: 3146

The best way to distribute Java files

I hava a Java project that relies on several libraries, which are distributed as JAR files. When I build my project, I end up with myProject.jar with a lib folder that contains a JAR file for each of the libraries I used.

To distribute my project, I suppose I could just zip up the entire dist folder, but that's not very clean.

Rather than making a separate executable for each platform (.app for Mac, .exe for Windows, ...) that contains the libraries, is there a way to make a single cross-platform file (preferably a JAR) that I can distribute?

Thanks!

Upvotes: 2

Views: 1173

Answers (3)

Adrian Petrescu
Adrian Petrescu

Reputation: 18059

There are many tools that pack up a bunch of JARs into one. Enrique's suggestion is a higher-level tool for distributing applications; a lower-level more direct tool to do exactly what you ask is JarJar.

Upvotes: 4

Serplat
Serplat

Reputation: 4447

You can consider using Java Web Start.

Basically, you create a configuration file and put it up on a web site, along with whatever JARs you need. In that configuration file, you can specify what it needs to download. After downloading everything, it puts an icon on the user's desktop for them to launch your program.

You can also configure it to automatically download updated JARs whenever necessary.

Upvotes: 5

Enrique
Enrique

Reputation: 10137

You can use IzPack

Upvotes: 2

Related Questions