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!