This post originated from an RSS feed registered with Java Buzz
by Marc Logemann.
Original Post: Using nested JARs in your Apps
Feed Title: Marc's Java Blog
Feed URL: http://www.logemann.org/day/index_java.xml
Feed Description: Java related topics for all major areas. So you will see J2ME, J2SE and J2EE issues here.
I stumbled over this a few times in my java career and i think thousands others too, which you can see on forums.java.com easily by searching for "JAR AND MANIFEST". The problem: You cant nest supporting JARs or better, 3rd party JARs inside your Application JAR. The result is the usage of native installers to unzip the supporting JARs to some location and reference them via MANIFEST (for J2SE apps of course). So the dream of a single JAR which can easily be started via "java -jar MyJar.jar" will remain a dream most of the times. (Despite of programs which are only playing tools and which dont need any external JARs).
Now i recently found this project called ONE-JAR. Simon went the hard way in writing an own classloader bootstrapping nested JARs and created an own format to express the resource locations inside nested JARs. Its all explained very well on IBMs java developerworks portal.
I have not tried it yet but i will give it a chance the next time i encounter this problem, right now i am doing mainly Webstart stuff, where you dont have any installation issues at all, but if you want to deploy J2SE the tradional way, it might be an interessting option.