Hi,
After installing jdk1.5 my program is compling but at the time of execution its giving error as Exception in thread main java.lang.NoClassDefFound error.I think it is problem of classpath.

actually ur O.S. is not recognizing the ".java" file format........

u have to sort that out first....

if u are using windows...go to windows explorer.....create a new extension as ".java"

u will get it....

Comments
Please refer to Java for Dummies about use of Java and setting path, dummy

Here I am giving a scenario to set class path

suppose jdk is installed in c;/java/jdk1.5

then follow the below three steps to set class path

set JAVA_HOME=C:\Java\jdk1.5.0_07

set path=;%path%;%JAVA_HOME%\bin

set classpath=%classpath%;%JAVA_HOME%\lib\tools.jar

Here I am giving a scenario to set class path

suppose jdk is installed in c;/java/jdk1.5

then follow the below three steps to set class path

set JAVA_HOME=C:\Java\jdk1.5.0_07

set path=;%path%;%JAVA_HOME%\bin

set classpath=%classpath%;%JAVA_HOME%\lib\tools.jar

If Java is installed in c:/java/jdk1.5 (and I am assuming it is c: and not c; as posted) then JAVA_HOME should be c:/java/jdk1.5 and not C:/Java/jdk1.5.0_07

Peter Buso.
i just copy pasted... after tens of attempts not working..
This worked FAST. in one go.
I'm not getting what worked. But it did.
:)
thanks.

Hi,
After installing jdk1.5 my program is compling but at the time of execution its giving error as Exception in thread main java.lang.NoClassDefFound error.I think it is problem of classpath.

right click on mycomputer click on advance tag, select environmental variable,click on new button in user variable then copy follow data

variable name:JAVA_HOME
varable value:c:\programFiles\java\jdk1.5.0;.

select new button
variable name:CLASSPATH
variable value:c:\programFiles\java\jdk1.5.0\lib;.

select new button
variable name:PATH
varable value:c:\c:\programFiles\java\jdk1.5.0\bin;.

This article has been dead for over six months. Start a new discussion instead.