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


Eric Gonzalez

Joined: May 01, 2002
Posts: 10
I have installed j2sdk1.4.1 and JBuilder which uses jdk1.3.1.
I make te hello world program an save it at my jdk141>
why when i try to compile I got the error java.lang.NoClassDefFoundError
* the path is well set up cause when I execute java -version from any where I got:
java version 'jdk 1.4.1' ..........
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059

Usually you get this error when you try to run the program, not when you compile it. Are you compiling at the command line?

By the way, I suggest that you pick a different subdirectory to put your source files in. The bin subdirectory of the jdk should be kept only for the files that came with the jdk.

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
From exactly what directory are you typing exactly what command and exactly where is the source file and what are your classpath and path settings (exactly)?

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Drake Silver
Ranch Hand

Joined: Apr 21, 2002
Posts: 80
hi, it's probably your JDK version.
I had the same problem until I changed the jdk version to 1.4
This is only my thought on what could be wrong, the previous posts have valid questions and responses.
good luck

"Shh, come one Now!"
bharat nagpal
Ranch Hand

Joined: Oct 26, 2002
Posts: 76
try one thing.....
modify your classpath to...:
c:\jdk141\lib\(jar file);%CLASSPATH%;.;
I agree. Here's the link:
subject: NoClassDefFoundError
It's not a secret anymore!