Help - Search - Member List - Calendar
Full Version: Java Error
Krazy Letter Forums > Technology > Tech Help > Programming Help > Java
Kiko
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
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
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
I'm pretty sure that CLASS won't take a filename or file path.

Anyways, Topic Moved
Kiko
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
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.
Invision Power Board © 2001-2010 Invision Power Services, Inc.