开发者

JAVA_HOME environment variable and Java JDK fun

开发者 https://www.devze.com 2023-01-18 14:09 出处:网络
I wanted to get Java running at 1.6xxx - I changed the JAVA_HOME variable and pointed it to the directory C:\\Program Files\\Java\\jdk1.6.0._16.

I wanted to get Java running at 1.6xxx - I changed the JAVA_HOME variable and pointed it to the directory C:\Program Files\Java\jdk1.6.0._16.

I restart the PC - and I think I can check which version开发者_开发知识库 of Java my machine is pointing at - but it still points to the older version of Java e.g v1.5.0_16

Can you help me rejog my memory on correct setup for Java JDK?

JAVA_HOME environment variable and Java JDK fun


You need to reset your path variable to point to 1.6

something like

JAVA_HOME environment variable and Java JDK fun

Additionally, make sure the variable JAVA_HOME is also set with the above location.


JAVA_HOME is used by other applications, such as Tomcat. Windows just checks the PATH environment variable for locations where it can find the java executable.


Try this on the cmd shell:

> java -version
java version "1.5.0_16"
> set PATH=%JAVA_HOME%\bin;%PATH%
> java -version


This Image will explain all steps.

JAVA_HOME environment variable and Java JDK fun

For More Explanation

0

精彩评论

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