Table of contents
Second, the cause of the problem
1. Encountered problems
JDK11 has been installed, and if you want to use JDK8, you download JDK8, and the environment variable is also configured with JDK8 (1.8). But cmd uses the command: java -version still shows the old version before, and does not show the version of JDK8 (1.8) just downloaded.
The environment variable configuration is JDK8
Check the current version information or the old JDK11
Second, the cause of the problem
In the path of the environment variable , the location of %JAVA_HOME%\bin is too low, not above, and the priority is not enough, the previously installed version will be displayed by default.
Three, the solution
1. Just move this Java environment variable to the front, so that the priority will be higher
2. Enter to view the name of the java version, and it has been found that the version has successfully become the newly installed jdk8 (1.8) version
java -version