NoClassDefFoundError

Plzz help me regarding this problem.

i created a file called HelloWorldApp.java Which contained the following

/**

* The HelloWorldApp class implements an application that

* simply displays "Hello World!" to the standard output.

*/

class HelloWorldApp {

public static void main(String[] args) {

System.out.println("Hello World!"); //Display the string.

}

}

this is located inC:\j2sdk1.4.2_11\bin>

in compilation

C:\j2sdk1.4.2_11\bin>javac HelloWorldApp.java

C:\j2sdk1.4.2_11\bin>java HelloWorldApp

Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp

i found the above error, so cosidering it to be an error due to classpath i did the following

C:\j2sdk1.4.2_11\bin>set CLASSPATH=C:\j2sdk1.42_11\bin

C:\j2sdk1.4.2_11\bin>java HelloWorldApp

Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp

STILL I AM GETTING THE SAME ERROR

CAN ANY BODY PLZ HELP ME WITH THIS

[1054 byte] By [gaana] at [2007-10-2 16:48:05]
# 1
Does this work?C:\j2sdk1.4.2_11\bin>java -cp . HelloWorldApp
gaana at 2007-7-13 17:59:04 > top of Java-index,Java Essentials,New To Java...
# 2

Try the following:/**

* The HelloWorldApp class implements an application that

* simply displays "Hello World!" to the standard output.

*/

public class HelloWorldApp { // <-- note: public

public static void main(String[] args) {

System.out.println("Hello World!"); //Display the string.

}

}

I would advise not puting your data (.java, .class etc) in the

same place you put your executables (.exe, .dll).

Make a directory like c:\java for your java work, or somewhere under

"Documents and settings". I also find CLASSPATH a bit inflexible. It

might be better to unset it and compile and run from whatever sensible

location you choose for your .java files with:javac -cp . HelloWorldApp.java

java -cp . HelloWorldApp

pbrockway2a at 2007-7-13 17:59:04 > top of Java-index,Java Essentials,New To Java...
# 3
this did work thanks Man i really appreciate it
gaana at 2007-7-13 17:59:05 > top of Java-index,Java Essentials,New To Java...