Cmd 'Where Java' Produces Two Results

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

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

Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.