Eclipse Java; export jar, include referenced libraries, without fatjar

The next version of Eclipse (3.5, due next June) has an option to include all necessary jars. It was introduced in 3.5M5 (thanks, basszero).

Or you can try to build your project with Maven 2. Then, you can build a "fat" jar with mvn assembly:assembly.

Another option is to use ant. Unpack all JAR files into a temp directory and jar them up again.


I think its version 3.3 of Eclipse (ganymede) that has Export as Runnable JAR file. Last time I tried it, it did include the referenced libraries and also un-jars all the jars.


This feature of eclipse works just fine to dump only the referenced libraries into separate folder. "Export as Runnable Jar" with "Copy the referenced libraries into a subfolder .." option.