NetBeans – deploying all in one jar [duplicate]

The basic problem is that the current version of Java does not support jars inside jars out of the box.

The recommended solution is to use the Class-Path line in the MANIFEST.MF file inside your jar to point to required libraries (relative paths are allowed) and then deploy all files together and invoking it with “java -jar your.jar”

If you really want to have a “jar-inside-jar” solution, we have used one-jar for several years, but gone away from it since our target JVM worked better with the solution described above.

http://one-jar.sourceforge.net/

I used it with the fatjar plugin in Eclipse. I do not have any experiences with building it into Netbeans, but it is simple to build into an ant script which I believe is what NEtbeans use anyway.

Leave a Comment