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.
精彩评论