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