Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting path for Java

 
rj jn
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have installed JDK 1.5 in my computer. But when i check the version of java in command prompt it shows as java 4.

C:\>java -version
java version "1.4.2_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)


I have also given the classpath in environment variables.
 
Maneesh Godbole
Saloon Keeper
Posts: 11178
15
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi "Rj jn",
Welcome to the ranch. We are happy to have you here

On the way in, it seems you have missed out on our naming policy. Could you please adjust your screen name to comply to the same?

Coming back to your question.
Can you check your "path" settings and tell us which java/bin is in the path?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
C:\>java -version

Windows will use the PATH environment variable, and check in each directory if it can find "java.exe". Be careful that if you have two JDK's bin directory set in your PATH, only the first one in the PATH will be used.
So, at the prompt, type "set", and check your PATH. Make sure that your JDK5's bin directory is there, before any other.
 
Rupesh Bonthala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
type this on the command prompt.

set path=<jdk home of java5>\bin;%path%
now if you type java -version,the java5 version will be used.
 
Maneesh Godbole
Saloon Keeper
Posts: 11178
15
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rupesh Bonthala:
Hi,
type this on the command prompt.

set path=<jdk home of java5>\bin;%path%
now if you type java -version,the java5 version will be used.


True, but after closing the command prompt, the path settings will be lost.
 
Puneet Mittal
Ranch Hand
Posts: 45
Eclipse IDE Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi welcome to java ranch. you can check the PATH environment variable defined in your system, if it has any variable related with jdk1.4 than delete it and define a new setting with the new jdk1.5 installed path. and also if you have two jdk's installed on your system, then delete the previous one ohterwise you will be in trouble sometimes......
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Setting the PATH under Windows is explained here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic