File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Jar issue - NoClassDefFoundError when attempting to run.  Class-Path set in MANIFEST.MF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Jar issue - NoClassDefFoundError when attempting to run.  Class-Path set in MANIFEST.MF" Watch "Jar issue - NoClassDefFoundError when attempting to run.  Class-Path set in MANIFEST.MF" New topic
Author

Jar issue - NoClassDefFoundError when attempting to run. Class-Path set in MANIFEST.MF

Rob lar
Greenhorn

Joined: Mar 29, 2010
Posts: 1
Hey all,

I spend most of my time doing web development, and rarely write standalone Java applications. A recent project had me put one together, and I'm banging my head against the wall with (what I believe are) Class-Path issues now.

The program I'm attempting to run has been packaged into a .jar. I'm using Maven to build it. There are 5 other jars that it is dependent on. I've put all 6 jars into the same folder for now for simplicity's sake.
The directory contains:

eBisDataFeed-201003.0.1.jar <- home of the main class
commons-logging-1.1.jar
commons-net-2.0.jar
exporter-200908.0.1.jar
jt400-5.4.0.4.jar
log4j-1.2.13.jar
poi-3.2-FINAL.jar

Maven is generating the following MANIFEST.MF file:


I get the following error message when I try to run this:


The class in question "com.mlb.sql.exporter.SQLScriptDirectoryDumper" is contained in the "exporter-200908.0.1.jar". I have verified the class is built and in there.

I've attempted to gut the entire main method, and just System.out.println("something");... which works... so I know it can find the main class.
It's when I re-include the code that is dependent on the SQLScriptDirectoryDumper that it gives me the error.

I'm at a loss. As far as I can tell, the MANIFEST is configured properly, and the classes are there.

What am I doing wrong?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Jar issue - NoClassDefFoundError when attempting to run. Class-Path set in MANIFEST.MF