My computer has several versions of jdk, JDK1.6 and jdk1.8, but my environment variables are set to jdk1.6. However, opening CMD to see Java version shows 1.8, which makes me puzzled. Later, problems were discovered.
Problem: under the path variable, JDK1.8 automatically generates variables for us, covering 1.7 of the original version.
Solution: 1. remove the C:\ProgramData\Oracle\Java\javapath in the path variable.
2.Move the%JAVA_HOME%/bin in the environment variable Path to the front end.
At this time, the Java -version again in CMD will display the information of the JDK version you configured.
This article is original for the author. If you need to reprint it, please indicate the source:https://www.cnblogs.com/luckypo/p/9564453.html