A DESCRIPTION OF THE REQUEST :
I have a java app A that uses jar libraries B and C.
I want to deliver A.jar as a single file for easy delivery and deployment, that can be run using a single command: "java -jar A.jar"
Unfortunately, there seems to be no simple method to do this. Unpacking B.jar and C.jar before creating A.jar might violate a licence on B.jar. The manifest classpath can't be set to do this.
In fact, the only solution seems to be a custom classloader. This problem should not be so difficult. It's the most natural thing in the world to want to deliver your app as a single file, and we now have no method to do this.
JUSTIFICATION :
Enough developers want this to have someone write a popular solution named One-Jar. (http://www-128.ibm.com/developerworks/java/library/j-onejar/ ) In fact, it is so popular that it was integrated with FatJar Eclipse Plugin.
Please fix this - this is a real problem for many developers.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expected a jar inside a jar file to correctly load it's classes.
ACTUAL -
I get assloads of NoClassDefFoundErrors and no simple way to fix it.
---------- BEGIN SOURCE ----------
Include any supporting jar file inside an application jar. Files in the internal jar can't be loaded.
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Get Eclipse and use FatJar Eclipse Plugin, or write your own custom classloader.
I have a java app A that uses jar libraries B and C.
I want to deliver A.jar as a single file for easy delivery and deployment, that can be run using a single command: "java -jar A.jar"
Unfortunately, there seems to be no simple method to do this. Unpacking B.jar and C.jar before creating A.jar might violate a licence on B.jar. The manifest classpath can't be set to do this.
In fact, the only solution seems to be a custom classloader. This problem should not be so difficult. It's the most natural thing in the world to want to deliver your app as a single file, and we now have no method to do this.
JUSTIFICATION :
Enough developers want this to have someone write a popular solution named One-Jar. (http://www-128.ibm.com/developerworks/java/library/j-onejar/ ) In fact, it is so popular that it was integrated with FatJar Eclipse Plugin.
Please fix this - this is a real problem for many developers.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expected a jar inside a jar file to correctly load it's classes.
ACTUAL -
I get assloads of NoClassDefFoundErrors and no simple way to fix it.
---------- BEGIN SOURCE ----------
Include any supporting jar file inside an application jar. Files in the internal jar can't be loaded.
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Get Eclipse and use FatJar Eclipse Plugin, or write your own custom classloader.
- duplicates
-
JDK-4092015 jar files should be allowed to contain other jar files
-
- Closed
-