简体   繁体   English

java -version与预期的不同

[英]java -version different than expected

I'm having a problem with determining what version of java am I using:) cmd.exe is using java.exe from C:\\WINDOWS\\system32 as specified in Path environment variable. 我在确定我使用的Java版本时遇到问题:) cmd.exe正在使用Path环境变量中指定的C:\\WINDOWS\\system32 java.exe

C:\WINDOWS\system32>java.exe -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode)

But in windows when I right-click on that file and select Properties->Version->Full Version it says 1.6.0_22-b04 . 但是在Windows中,当我右键单击该文件并选择Properties->Version->Full Version它显示为1.6.0_22-b04

Why? 为什么?

This means you have two installations. 这意味着您有两个安装。 Check your c:\\program files\\Java folder. 检查您的c:\\program files\\Java文件夹。 Also check your PATH environment variable - it should point to the correct path. 还要检查您的PATH环境变量-它应该指向正确的路径。

Change to a directory which is not in your PATH environment variable and run java -version . 切换到不在PATH环境变量中的目录,然后运行java -version Note that the current directory always is the first entry in PATH . 请注意,当前目录始终是PATH的第一个条目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM