Problem Description:
Today suddenly want to write a small application of socket communications, respectively, using bio, NIO, AIO way to achieve, to review the previous reading about TCP/UDP communication knowledge. The jdk1.8 was re-installed on the machine where the jdk1.6 was originally installed. The result is a very painful problem: My original Java_home configuration has not changed at all, but the command line execution java-version appears to be the 1.8 version, and Javac-version appears to be the normal 1.6 version.
Cause Analysis:
Reference Http://www.oschina.net/question/942785_103000?fromerr=U6XKsOdO, the main reason is that javac-version is made by Java_ The Java version in the path specified by home is determined. And the Java.exe in Java-version is based on the system environment variable path, which was previously configured as the path variable in my system: Java_home related configuration at the end, that is, behind the system32. This is because each time the JRE is installed, the Java.exe copy to the System32 path, and java-version will be the variable path configuration in turn, if found is not continuing to look for, which leads to Java-version is always the latest version of Java.
Workaround:
In fact, just move the Java_home-related configuration in the system environment variable path to the front. The other can delete the Java.exe javaw.exe javaws.exe in System32, delete the registry, and so on.
Java-version incorrect questions about installing multiple versions of the JDK