File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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


Ramm Kummar

Joined: Feb 10, 2009
Posts: 26
Getting this error while running java. Please suggest. I have defined required things in the classpath

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
You always need to give the fully qualified classname: "java com.wickedlysmart.CmdArgs". This should work assuming that the "classes" directory is in the classpath.
Eric Larsen
Ranch Hand

Joined: Mar 28, 2009
Posts: 35
From what I can see, you are currently in the same directory as your .class file. Instead of running the class from here, you should run it from the /classes directory, like this:

C:\MyProject\classes\>java com.wickedlysmart.CmdArgs

That is, assuming that the class includes a package statement at the beginning of the file:

I agree. Here's the link:
subject: NoClassDefFoundError
It's not a secret anymore!