简体   繁体   中英

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

我需要在命令行上运行java -jar,所以安装了jdk6但是每当我在命令行中执行java -version时它仍然显示旧版本(1.3)如何更新它以显示最新版本?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM