AdamOutler
AdamOutler

Reputation: 900

Packaging /libs/*.jar into a single jar?

For the purposes of a clean cross-platform distribution, I'd like to have a single JAR file which contains everything required for the project.

however, I have an external lib in my ./lib folder

adam@Adam-Desktop:~/code/HeimdallOneClick/dist$ ls -Rl
.:
total 339676
-rwxr-xr-x 1 adam adam 347818157 2011-06-26 16:13 HeimdallOneClick.jar
drwxr-xr-x 2 adam adam      4096 2011-06-26 16:18 lib
-rw-r--r-- 1 adam adam      1331 2011-06-26 16:13 README.TXT

./lib:
total 260
-rw-r--r-- 1 adam adam 264192 2011-06-26 16:13 appframework-1.0.3.jar

Is there a way to build this relatively small JAR file into my main JAR and then decompress at runtime so that I have only a single file as a distribution?

Upvotes: 1

Views: 341

Answers (1)

anon
anon

Reputation:

http://one-jar.sourceforge.net

This is a commonly used utility for just this purpose. There are also plugins for popular IDEs to make it painless.

Upvotes: 4

Related Questions