Kiko
Mar 14 2006, 04:30 PM
Any ideas how to fix the following error?
Exception in thread "main" java.lang.NoClassDefFoundError: (name).class
Using Windows XP.
Yes I do have JDK installed.
I have tried setting a PATH from
System > Advanced > Environmen Variables > New >
Variable name: PATH
Variable value: C:\Program Files\Java\jdk1.5.0_06\bin (java jdk bin directory)
Any help would be appreciated.
Mynck
Mar 14 2006, 04:39 PM
What's the context here? Are you running java.exe from a command line?
If you are, sometimes I find that random class not found errors can be fixed by using the -classpath argument. Even when the class file is in the current directory, it might not work for me unless I type in like
"C:/Folder>java -classpath ..\Folder /*NAME GOES HERE*/"
Or maybe you just forgot to capitalize the name of the class?
Oh, and also, java.exe takes the class name, not the filename.
Kiko
Mar 14 2006, 04:54 PM
Thanks for you time. I FINALLY figured out what was wrong. I had to change the CLASSPATH too, not just the path for CLASS. If that doesnt make sense, it doesn't matter, cause its working now.
Mynck
Mar 14 2006, 04:58 PM
I'm pretty sure that CLASS won't take a filename or file path.
Anyways, Topic Moved
Kiko
Mar 14 2006, 05:03 PM
No sorry, its a variable value that tells programs where to find java in order to compile.
If you are running XP go through this and you'll see what I mean.
CP > System > Advanced > Environmen Variables
Mynck
Mar 14 2006, 05:12 PM
Oh, I see. But. Um.
Oh. It's a... system variable pointing to the Java library?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.