NoClassDefFoundError
Hello every one
I have Windows Xp & have installted Jdk1.4
On compilation no problem but when I run the my prgram
using the following command:
C:\jdk1.4\bin\javaC:\jdk1.4\MyClass
I get the message below:
Exception in thread "main" java.lang.NoClassDefFoundError: C:\jdk1.4\MyClass
I know I must set the ClassPath but how?
Any Clues?
> using the following command:
>
> C:\jdk1.4\bin\javaC:\jdk1.4\MyClass
>
The argument to the java command is the name of the Class, not a file or path. If your class is not in a package and its name is MyClass, then the command must be "java MyClass"
I suspect you will still get an error because it looks like the file MyClass.class is in the c:\jdk1.4 directory. A simple solution is "java -classpath c:\jdk1.4 MyClass" - note the space between 1.4 and MyClass.
Here's some info that may help.
http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html
http://java.sun.com/j2se/1.4/install-windows.html#Environment
http://java.sun.com/j2se/1.4/docs/tooldocs/tools.html