1. Questions
For example, after installing the JDK7, then install jdk6,java-version is to display java1.6, even if the java_home and path changes to Java7 path, Java-version still display 6.
2. Solution
When installing the JDK, you will voluntarily copy the Java.exe to C:windows/system32. The first path configured in Path is system32. So the Java in the java-version you run is actually Java in System32, not Java in Java_home.
The workaround is very easy. Change path, put the%java_home%/bin in front of the system32 can be.
C:\documentsand Settings\administrator>pathpath=c:\documentsand Settings\administrator\myeclipseProfessional 2014\binaryCom.sun.java.jdk7.win32.x86_1.7.0.u45\ Bin; C:\ Windows\system32; C:\ Windows; C:\windOWS\system32\wbem; C:\programFiles\commonFiles\thunderNetwork\kankan\codecs; C:\programFiles\thinkpadWireless LAN Adapter Software; C:\bea\tuxedo8.1\ Bin; C:\PROgram Files\TORTOISESVN\ Bin;D:\mongodb\ Bin;D:\redis; F:\resource\maven3/bin; C:\miNGW32\ Bin; C:\programFiles\nodejs\;E:\gradle\gradle-2.4-all\gradle-2.4\ Bin; C:\PROgram Files\stormii\codec; C:\programFiles\stormii; C:\programFiles\IDMComputer Solutions\ultraedit\;C:\documentsand Settings\administrator\applicationData\ nPm
C:\and Settings\Administrator>-version"1.7.0_45"1.7.0_45-b1824.45-b08, mixed mode)
Blog from Ouyida3
2015.6.25
Install multiple version numbers after JDK java-version does not change the problem solved