JAVA_HOME environment variable and Java JDK fun

喜你入骨 提交于 2019-12-12 07:47:41

问题


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?


回答1:


You need to reset your path variable to point to 1.6

something like

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




回答2:


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.




回答3:


Try this on the cmd shell:

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



回答4:


This Image will explain all steps.

For More Explanation



来源:https://stackoverflow.com/questions/3820954/java-home-environment-variable-and-java-jdk-fun

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!