Share this page 

Deploy an application as only 1 jarTag(s): Open Source


Any non-trivial Java application is going to rely on any number of supporting Jar files. So your deployment will include your application jar plus the supporting jars (ex. Apache Commons, Log4j,...).

Unfortunately it's not possible to include a jar into another jar because the Java classloader does not know how to load classes from a Jar inside a Jar.

One-Jar is special classloader able to do this. The One-JAR JarClassLoader looks for a main program inside a main directory in the Jar file, and looks for supporting Jar files inside a lib directory.

The kit includes a special ANT task to simplify the process of preparing your application to be distributed as a One-Jar application.

Fat Jar
The Fat Jar Eclipse Plug-In is a Deployment-Tool which deploys an Eclipse java-project into one executable jar.