troubleshooting Question

how to set classpath jar file while jar in jar file?

Avatar of iphone
iphone asked on
Java
10 Comments1 Solution1693 ViewsLast Modified:
for example i have files:

----------------------
mianclass.txt
a.jar
myclass.class
----------------------


mianclass.txt contain:
--------------------------
Main-Class: myclass
-------------------------

and i make a jar file again
---------------------------------------------------------
jar cmf mainclass.txt run.jar myclass.class a.jar
---------------------------------------------------------

so i got file run.jar,and i run the file
-------------------
java -jar run.jar
--------------------

when i run the file it got error like this "Exception in thread "main" java.lang.NoClassDefFoundError".
How to set classpath a.jar? it set in mainclass.txt or where?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 10 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros