cmd 'where java' produces two results

When I do where java in the cmd terminal, I get the following results:

C:\Program Files\Java\jdk1.7.0_25\bin\java.exe
C:\Windows\System32\java.exe

Is it meant to do that? I thought it should only produce the first result as that's what's set in my Path environmental variable. I am using Windows 8 if that helps.

2

2 Answers

C:\Program Files\Java\jdk1.7.0_25\bin\java.exe is the entry you get because you defined it in the Path.

You are getting the second one, because you have a java.exe in your System32 folder. I guess the installer did this.

2

By default your PATH always have C:\Windows\System32, where just looks for the location of the file with search pattern and in your case, you added jdk bin location to your PATH, also your system32 folder also has java.exe, thats why you see two entries in your output.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like