This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes jar files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "jar files" Watch "jar files" New topic
Author

jar files

Terrence White
Ranch Hand

Joined: Jun 26, 2002
Posts: 39
Is there a way for me to place jars inside of an executable jar and get it to run?
When I put them inside of my executable jar, the files cannot be found, and I get the infamous "java.lang.NoClassDefFoundError" error.
How can I get the classpath to look into the executable jar?
I tried editing the manifest:
Class-Path: firstFile.jar secondFile.jar
But this only works if the jar files are in the same directory as the executable jar.
My jar files are inside of the executable jar.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Unpack the "nested jars" and jar them along with the other classes.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jar files
 
Similar Threads
How classpath works for executable Jars
finding files in a jar
about jar file
Jars inside one jar?
Imbedded jar file