Home  >  Article  >  Java  >  java version version is wrong

java version version is wrong

angryTom
angryTomOriginal
2019-11-20 10:43:103167browse

java version version is wrong

java version is wrong

When you have multiple versions of jdk installed, you may encounter changes After JAVA_HOME the java -version version is inconsistent.

Generally, change your JAVA_HOME to the installation path of the jdk you want to use, and then you will use this version of JDK. But sometimes you will find that java -version does not change after changing JAVA_HOME. (Recommended tutorial: java tutorial)

Possible reasons:

# In the path of ##path, some path directories also contain java.exe, and then the path is in front of

%JAVA_HOME%\bin, so the java.exe in the previous path is preferred when running, so No matter how you change JAVA_HOME, java -version remains unchanged

Solution:

After modifying JAVA_HOME, add %JAVA_HOME at the front of the path %\bin;To ensure that JAVA_HOME is referenced first.

Question: Why not change the user variables? Because the system preferentially refers to environment variables in system variables. System variables are for all users, and user variables are only for the current user.

The above is the detailed content of java version version is wrong. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn