0

I'm trying to determine the location of an executable (java.exe) on Windows. I know it must exist somewhere in the PATH since I can run it, but I don't know the exact directory that it is being run from. On a UNIX system I could use the whence command to obtain this information. Is there an equivalent command for Windows systems?

An̲̳̳drew
  • 1,265
  • 2
  • 14
  • 19

6 Answers6

5

On my Vista laptop if I type "where java.exe" from the command prompt it gives me the location of java.exe.

Hope this helps.

hulbs9nw
  • 336
  • 1
  • 2
  • 8
1

Not exactly. You have a few choices:

  • At a command prompt from the root of C: run: Dir /s java.exe
  • install the win32 port of which.exe (there may be a whence.exe port too)
  • use the search functionality in windows explorer
  • get one of several third party windows file indexing and searching utilities
EBGreen
  • 1,453
  • 11
  • 10
1

Install this: http://gnuwin32.sourceforge.net/packages/which.htm Then open a command prompt and type: which java

Sean Staats
  • 810
  • 7
  • 6
0

In a command prompt type "path".... that will give you your path you can also use the "find" command.

geeklin
  • 528
  • 2
  • 10
0

Check out the first Google hit for "equivalent whence windows". You'll have to write a small utility to do it.

0

Here's a "whereis" script from Raymond Chen's blog:

http://blogs.msdn.com/oldnewthing/archive/2005/01/20/357225.aspx

An̲̳̳drew
  • 1,265
  • 2
  • 14
  • 19