Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NoClassDefFoundError Error - URGENT

Status
Not open for further replies.

vivekm

Programmer
Oct 4, 2000
76
GB

Hi,

I am very new to Java. I am trying to use java to parse an XML and XSL file into a plain text file. This procedure is using a new class in a jar file. The files location has been added to the PATH environment variable as well as CLASSPATH (using WINDOWS 2000). No luck.

The command being used is:
java -D com.jclark.sax.xsl.Driver <xml_file> <xsl_file> <output file>

Error returned is:
Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: com/jclark/sax/xsl/Driver

Thanks,
Vivek
 
The class name is case sensitive, that's often why I have that error. If that doesn't work, check classpath
 

How do I check the class names/cases match? Can I delve into the jar files to get this info.

The files, I have been told by previous developer to use are sax.jar, xerces.jar, xp.jar and xt.jar. These files are located in c:\com\jclark\sax\xsl\driver directory along with the XML and XSL files.

Looking at the error,
1. Is it possible that these files need to be located in a special place? If so, where and does my classpath needs to point to this?
2. The error contains '/'. On Win2K, directories are separated by '\' - Is this another problem?

Kind Regards,
Vivek

 

PANIC OVER!!!! I extracted the contents of the jar file and found the order of directory structure was not com/jclark/sax/xsl/Driver as stated in the documentation but com/jclark/xsl/sax/Driver

THANKS FOR YOUR HELP ANYWAYS.

Regards,
Vivek
 
Another useful tip to keep in mind is that Jar files are compressed using ZIP algorithm. You can open them using any ZIP utility such as WinZip to explore inside using a GUI utility as well as the jar command-line tool.
 
Or you can extract at that command line:

jar -xf nameofjarfile.jar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top