question:
After directly changing the JDK installation path of Java_HOME, the environment variable does not take effect. Is an error reported after entering java -version or javac -version in the cmd window? ? ? Why is this?
Problem analysis:
When using the installed version of the JDK program, the three executable files java.exe, javaw.exe, and javaws.exe will be automatically copied to C:\Program Files(x86)\Common Files\Oracle\Java\ javapath 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 the JDK installation path of JAVA_HOME will be invalid!
Solution:
Delete directlyC:\Program Files(x86)\Common Files\Oracle\Java\javapath directory! ! !
Come to the CMD window to verify: