Java-version incorrect questions about installing multiple versions of the JDK

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.