Solve the problem of jdk8 after win7 is installed. Has value ‘1.8’, but ‘1.7’ is required

I win7 x64 Ultimate Edition, installed JDK7 and jdk8 at the same time, after uninstalling jdk8, the CMD command line input: Java – version, originally thought to display java version 1.7, the result of error: has value ‘1.7’, but ‘1.8’ is required

I look at Java_ Home, the environment variable, is found to be OK, pointing to C:// Java/jdk1.7.0


After JDK7 is installed, jdk8 is installed, because when JDK1.8 is installed, java.exe, javaw.exe and javaws.exe are automatically copied to the directory C: (Windows) system32, because the priority of this directory in the windows environment variable is higher than Java_ The priority of the environment variable set by home.

After understanding this, you will know the cause of the error. Although JDK1.8 has been uninstalled, the three executable files of java.exe, javaw.exe and javaws.exe in the directory of C: (Windows) system32 are still JDK1.8, so the Java version of jdk1.7 is_ Copy the three corresponding executable files under home/bin to the directory of C: Windows/system32. At this time, enter Java – version on the command line of CMD, and everything is normal.

My situation is just the opposite of his, so I replace several files of jdk8 and overlay them in the directory of C: (Windows) system32.

According to the above modification, enter Java – version in CMD to display version 1.8

Read More: