This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Java in General and the fly likes NoClassDefFoundError on application Jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "NoClassDefFoundError on application Jar" Watch "NoClassDefFoundError on application Jar" New topic

NoClassDefFoundError on application Jar

Alan Shiers
Ranch Hand

Joined: Sep 24, 2003
Posts: 237
Hi Guys,

Hope you can help. I've packaged up my project into a Jar file with the that reads:

Manifest-Version: 1.0
Class-Path: lib/fdsapi.jar lib/jakarta-oro-2.0.8.jar lib/JAMon.jar
Main-Class: parser.MainGUI

As you can see my application relies on three library jar files that reside in the lib directory. I've opened the jar file and the lib directory does exist there and the jar file are there also. When I use the commend java -jar pns.jar the application runs but it stalls when it is unable to locate a class that resides in one of the library jars. What more might I need to do to make sure these library jars wind up in the classpath?

Rob Spoor

Joined: Oct 27, 2005
Posts: 20279

The lib folder shouldn't be placed inside the JAR file, but in the same folder as the JAR file.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: NoClassDefFoundError on application Jar
jQuery in Action, 3rd edition