Workarounds for Java and Javac version inconsistencies in the Java Runtime environment variable configuration

Source: Internet
Author: User

Original posts:http://www.cnblogs.com/shined/p/4492615.html

Problem Description:

No problem with Java configuration found in Windows command-line window by running Java and JAVAC statements

Figure 1:

Figure 2:

However, the installation directory for the environment variable java_home to jdk1.5.0_14 is set, and%java_home%\bin is added to the path variable, but under Windows command line,

Execution Java-version shows:

Java Version "1.6.0_13"

and the execution javac-version display:
Javac 1.5.0_14

Two versions are inconsistent.

Cause Analysis:

Jdk1.5.0_14 and jre1.6.0_13 are also installed. When you execute a command from the WINDOWS command line, you search for it from the current directory, and then follow the path set to find the command, and the JRE installation will install Java.exe to the C:\WINDOWS\system32 directory, so execute the java-version command, you are viewing the version of the JRE , and the version of the JDK that is viewed when javac-version .

Workaround:

Add%java_home%\bin to the header of the path variable and execute java-version and javac-version, both 1.5.0_14 versions.

Workarounds for Java and Javac version inconsistencies in the Java Runtime environment variable configuration

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.