0

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.

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.

Why?

0

2 Answers 2

4

This means you have two installations. Check your c:\program files\Java folder. Also check your PATH environment variable - it should point to the correct path.

Sign up to request clarification or add additional context in comments.

Comments

1

Change to a directory which is not in your PATH environment variable and run java -version. Note that the current directory always is the first entry in PATH.

3 Comments

Bingo. It's invoking the one that resides in C:\Windows\System32
@Mark, I hate it... This forced to write which for windows.
Yeah, the *nix alternative where you have to manually do ./someBinary is confusing at first ("why do I need to specify the directory if I'm already in it?") but avoids problems later.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.