About the installed version of JDK1.8 1.7, changing multiple JDK environment variables does not take effect

Phenomenon:

When you want to change the system environment variables after using the installed version of JDK, it is invalid to directly change JAVA_HOME

Reason :

When using the installed version of the JDK program (usually version 1.7 or above), the installer will automatically change the java. exe, javaw.exe, javaws.exe three executable files are copied to the C:\Windows\System32 directory, the priority of this directory in the WINDOWS environment variable is higher than the priority of the environment variable set by JAVA_HOME, so directly changing JAVA_HOME will be invalid .

In addition, the JDK1.8 installation version will also generate some configuration files in the C:\ProgramData\Oracle\Java directory, and write this directory to the Path in the environment variable at the same time.

Solution:

Delete the three files java.exe, javaw.exe and javaws.exe in the C:\Windows\System32 directory.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325575103&siteId=291194637