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


N Nanda
Ranch Hand

Joined: Feb 09, 2004
Posts: 62
Hi All...
I am using Java1.4 on Windows 2000 server. Everything was working fine till somedays ago. But now when I am trying to run even a simple "Hello World" java program, its showing error like
Exception in Thread "main" java.lang.NoClassDefFoundError
Please help as soon as possible.Thanx in advance.
Niranjan Nanda

Regards<br />--<br />Niranjan Nanda<br />Consultant<br />Capgemini Consulting India <br />Mumbai<br />Phone: 9324951476
Sheeba lalith

Joined: Feb 16, 2004
Posts: 2
This is because you may have missed out the entry for current directory in your classpath. CLASSPATH variable looks for all the locations you specified part of the classpath for locating the class files.
Just type set to see the list of environment variable settings and look for the entry classpath.If it doesn't contain the entry for the current directory(hoping you are executing the application from the directory having the class files.),set the classpath at the prompt as follows:
set classpath=%classpath%;.
If this is OK,then u need to look at the file name.When you interpret the application ,you should give the same name that you specified while naming the class,in the correct case.

Hope this helps.

set classpath=%classpath%;.
N Nanda
Ranch Hand

Joined: Feb 09, 2004
Posts: 62
Thanx a lot. It worked.
I agree. Here's the link:
subject: NoClassDefFoundError
It's not a secret anymore!