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.

9
Contributors
12
Replies
13
Views
10 Years
Discussion Span
Last Post by tsr_tvsk

>I think it is problem of classpath.

Well have you set it properly?

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....

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

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....

Please ignore this answer it is wrong, iamthwee is right for more instruction follw the link bellow
http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/classpath.html

you actually understood that highly cryptic message?

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

Does this work?

Does this work?

Which part you did not understand?

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.

who is this "Peter Buso" person you're talking to?

Sorry jwenting I'm not so touchy, there is no need for it

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 topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.