0

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
9 Years
Discussion Span
Last Post by tsr_tvsk
-1

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

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

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

0

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

0

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.

0

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.