How do I compile a JAR file that is truly self-contained?
Posted on 2008-10-06
I am developing a piece of Java code that will be run as a scheduled task on another machine. The code currently uses functionality out of two precompiled .jars: "mail.jar" and "activation.jar". When I compile the code, I'm able to run the resulting .jar file, but only if it's in a directory that contains "mail.jar" and "activation.jar" in a "lib" directory (as in the "dist" directory). What I'm looking for is a way to modify the build.xml file or change some settings in the IDE so that it will build all of the classes in any .jar file I add to the compile-time libraries list into the final .jar, allowing it to be completely self-contained.