Java-version javac-version Version inconsistency
The system first installed the jdk1.8, the environment variable is configured Jdk1.8,java-version and javac-version version of the same.
Then installed the jdk1.7, the environment variable java_home changed to 1.7, but the cmd input java-version and javac-version
Version is not consistent, one is java-version display is 1.8,javac-version is 1.7
It is said that when you run the Java command, you start looking in front of the path, and you will not find it in the back.
Resolve version inconsistency method: Take path
%java_home%\bin;
Put it to the front.
As follows
%java_home%\bin;%systemroot%\system32;%systemroot%;%systemroot%\system32\wbem;%systemroot%\system32\ Windowspowershell\v1.0\;%maven_home%\bin;d:\program Files\tortoisesvn\bin
Probably because my jdk is an. exe installation file, installed. Some information about Java is written in the system. I put%java_home%\bin; Put it in the%SystemRoot%\System32, back, below.
%systemroot%\system32;%java_home%\bin;%systemroot%;%systemroot%\system32\wbem;%systemroot%\system32\ Windowspowershell\v1.0\;%maven_home%\bin;d:\program Files\tortoisesvn\bin
The version is inconsistent.
PS: Change the environment variable, to reopen a cmd window.