The moose likes Beginning Java and the fly likes no class found error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "no class found error" Watch "no class found error" New topic

no class found error

Paul Keohan
Ranch Hand

Joined: Mar 15, 2000
Posts: 411
Can anyone give me some ideas here?
I am getting a java.lang.NoClassDefFoundError error while running an application. It displays the error and the directory path of missing class. The class DOES exist in this directory and my lookup class compiles cleanly so what am I missing? I have checked classpaths and added the class to a common jar file that's being read - all to no avail.
If anyone can give me some further ideas on what's wrong, I'd much appreciate it.
Fred Hosch

Joined: Apr 16, 2001
Posts: 23
In my experience, this is almost always a CLASSPATH problem.
Are you sure the process you're running has the same CLASSPATH
as the one you're looking at? Does it find other classes in
the same package as the lost one?
Fred Hosch
Author of:
An Introduction to Software Construction with Java

Fred Hosch<br />Author of:<br /><a href="" target="_blank" rel="nofollow">An Introduction to Software Construction with Java</a>
ryan burgdorfer
Ranch Hand

Joined: Jan 24, 2001
Posts: 219
Also, note that everytime you make a change to an environment variable (like CLASSPATH, PATH, etc.) you have to close/re-open any program you are using for the changes to be realized. It took me a minute to figure that out back when I was setting up the JDK for the first time and configuring my classpath/path. I couldn't understand why my changes apparently had no effect
  • Ryan Burgdorfer
  • Java Acolyte

<UL TYPE=SQUARE><I><LI>Ryan Burgdorfer<BR><LI>Java Acolyte</I></UL>
Steven YaegerII
Ranch Hand

Joined: May 31, 2000
Posts: 182
Also, in System Configuration Utility, under the General tab, you'll want to make sure the "process Autoexec.bat file" checkbox is checked. This shouldn't be a problem, though, if you haven't tweaked your PC in the past and altered the settings.
I agree. Here's the link:
subject: no class found error
It's not a secret anymore!