Skip to main content

Deliver Your Java Application in One-JAR!

Posted by felipegaucho on November 23, 2005 at 11:10 AM PST

These days I'm finishing another course about Java and JDBC - everything was ok during the course and I decided to deploy the complete sample application to my students through their mailing list. The project is a simple Swing/JDBC application accessing a few tables in the MySql.

When I created the deployable JAR I detected a surprising detail: I can´t distribute my application in a single JAR because there is a dependency with the MySql - and the driver couldn't be accessed inside the application JAR due to classpath details.

This is a strange feature of the JAR tool because it force the users to download several files or use an external unzip tool in order to unzip the files before running the aplication - very odd.

I know we can use WebStart with its fantastic features - but I´m trying to distribute a simple application, it seems much more elegant if I got it packed in a only file.

There is an interesting project that inspired this entry, called One-JAR and a nice explanation about it usage on this site.

I opened a thread in the Java Programming Forum and the answers motivated me to share this curious gap about the JAR tool.

Related Topics >>