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.

Recommended Answers

All 12 Replies

Member Avatar for iamthwee

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

commented: Please refer to Java for Dummies about use of Java and setting path, dummy -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....

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.