954,124 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Path setting problem in jdk1.5

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.

abhijeet_raj
Newbie Poster
1 post since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

>I think it is problem of classpath.

Well have you set it properly?

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

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

indianscorpion2
Junior Poster in Training
82 posts since May 2005
Reputation Points: 9
Solved Threads: 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

peter_budo
Code tags enforcer
Moderator
15,432 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 901
 

you actually understood that highly cryptic message?

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

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

bhavanivishnu
Newbie Poster
1 post since May 2007
Reputation Points: 10
Solved Threads: 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 isc: and not c; as posted) then JAVA_HOME should be c:/java/jdk1.5 and not C:/Java/jdk1.5.0_07

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

Does this work?

CAESARIO
Newbie Poster
6 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 
Does this work?

Which part you did not understand?

peter_budo
Code tags enforcer
Moderator
15,432 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 901
 

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.

CAESARIO
Newbie Poster
6 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

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

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

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

peter_budo
Code tags enforcer
Moderator
15,432 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 901
 
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;.

tsr_tvsk
Newbie Poster
2 posts since Mar 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You