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?

[391 byte] By [mohammd_rezaa] at [2007-9-28 10:25:52]
# 1

> 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

atmguya at 2007-7-12 0:17:41 > top of Java-index,Developer Tools,Java Compiler...
# 2
Let me know when you figure it out, I am having the same problem.
seagirlUSa at 2007-7-12 0:17:41 > top of Java-index,Developer Tools,Java Compiler...
# 3
> Let me know when you figure it out, I am having the> same problem.This poster posted valuable information - the exact command and error message. You did not.
atmguya at 2007-7-12 0:17:41 > top of Java-index,Developer Tools,Java Compiler...