Error: Exception in thread
Hi All,
I am a new member on this forum. I am trying to learn java. I wrote my first java program and finding difficulty in execution of the same.
The program is a simple 'Hello World' program. I am using J2sdk1.4.2_06 and failing to run the java program using the command prompt on Windows XP Professional.
My code is:
class myfirstjavaprogram
{
public static void main(String args[])
{
System.out.println("Hello World");
}
}
I was able to compile the program successfully but got an error when tried to run the program.
Error that I got is:
Exception in thread "main" java.lang.NoClassDefFoundError: myfirstjavaprogram
Any and all help with this regards is highly appreciated.
Thanks & Regards,
Priti
[812 byte] By [
priti07a] at [2007-10-3 9:12:14]

I am also new to java, last time I have this error was I incorrectly install JAVA SDK. but the problem solved when I reinstall sdk and jre. I think the original classpath is not correct, so java cannot found the related class , perhaps I have 2 version of sdk and got the path messed up.
your code is ok I think.
Hi,
Can someone please tell me if I am doing something wrong in setting the classpath, stated below. I changed the classpath by right-clicking the 'My Computer' icon on my desktop.
From the 'Properties' dialog box, I clicked on 'Advance' tab and selected 'Environment Variables' button. I changed the classpath to
%C:\j2sdk1.4.2_06\bin%;.
Am I doing anything wrong?
Regards,
Priti
Hi
MyComputer ->right click-select -properties-select advanced
in path option mention: C:\j2sdk1.4.2_06\bin;
in Classpath option mention :C:\j2sdk1.4.2_06\lib;.;
this (;.; ) can indicates to JVM current directory is working area..
thanks®ards
naveen.m