File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "NoClassDefFoundError" Watch "NoClassDefFoundError" New topic
Author

NoClassDefFoundError

Pruthvi raj
Greenhorn

Joined: Dec 30, 2008
Posts: 1
i have java file One.java in Test directory and i am comipiling this file as java Test.One as my present working directory as c:\Test but its throwing error.Can anybody please suggest.
And even tried java -classpath . Test.One, then also same problem.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14144
    
  18

Welcome to JavaRanch. NoClassDefFoundError (almost) always means that your classpath is not set correctly.

i have java file One.java in Test directory and i am comipiling this file as java Test.One

You mean, that's how you run (not compile) the class. Has One.java a package statement at the top of the source file, like this:

If that's the case, then you need to add the parent directory of the directory named Test to the classpath. Since directory Test is in the root directory, try this:

(note the space between C:\ and Test.One).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoClassDefFoundError