mahome
asked on
How to set classpath for jar in jar
Hello Experts,
I've created a jar with the content as you see below. A main class and required jars under lib folder.
In the manifest I included the required jars in the classpath.
But when I want to start application with: java -jar myapp.jar I'm getting the following error:
Exception in thread "main" java.lang.NoClassDefFoundE rror: javax/xml/rpc/ServiceExcep tion
So it seems that jaxrpc.jar is not found and s.th. with the classpath is incorrect.
Please help me to correct my classpath.
I've created a jar with the content as you see below. A main class and required jars under lib folder.
In the manifest I included the required jars in the classpath.
But when I want to start application with: java -jar myapp.jar I'm getting the following error:
Exception in thread "main" java.lang.NoClassDefFoundE
So it seems that jaxrpc.jar is not found and s.th. with the classpath is incorrect.
Please help me to correct my classpath.
jar content:
de/myapp/MyMain.class
META-INF/MANIFEST.MF
lib/jaxrpc.jar
lib/axis.jar
...
manifest:
Manifest-Version: 1.2
Main-Class: de.myapp.MyMain
Class-Path: lib/axis.jar lib/jaxrpc.jar ...
Created-By: 1.5.0_15 (Sun Microsystems Inc.)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://fjep.sourceforge.net/
take the jars out of the jar and instead put them in a lib directory with your application jar.
That should work (and makes it easy to upgrade the external jars without having to build a new jar)
That should work (and makes it easy to upgrade the external jars without having to build a new jar)
ASKER
Thanks for your fast help.
:-)