开发者

Java -version shows 1.3 when I updated the classpath to c:\java\jdk1.6.0_20\bin

开发者 https://www.devze.com 2023-04-04 11:30 出处:网络
I need to run a java -jar on command li开发者_运维百科ne and so installed jdk6 but whenever i do java -version in command line it still shows the old version (1.3) How do I update it to show the lates

I need to run a java -jar on command li开发者_运维百科ne and so installed jdk6 but whenever i do java -version in command line it still shows the old version (1.3) How do I update it to show the latest version ??


Add the new Java bin folder to your path. And remove any other java references from your path.


You should set the PATH environment variable. On the command prompt, do:

> set JAVA_HOME=c:\java\jdk1.6.0_20
> set PATH=%JAVA_HOME%\bin;%PATH%

Now doing java -version should give you the expected version information.


The JDK install does not update the default Java installation on the system.

Go to http://java.com/en/download/installed.jsp and use the suggested installation procedure there when it finds that your default Java is outdated.

0

精彩评论

暂无评论...
验证码 换一张
取 消