How to find out if I use java.exe from a jdk, a jre or a javaEE installation?

R

Robin Wenger

Assume I am working on a unknown computer (from a friend/colleague) where some pre-installed Java installations exist.

When I type on a command prompt/terminal:

java -version

the output tells me if java.exe is part of a JavaSE or JavaEE installation.
But it does NOT tell me if I use

java.exe from the jdk path/part or the jre path/part.

How can I find out (in Win) WHICH java.exe I used in detail?

Keep in mind that there could be further applications/developments tool which might bring their own
jdk/jre installation.

So java.exe could be called from these additional installations as well.

Robin
 
K

kedar mhaswade

Assume I am working on a unknown computer (from a friend/colleague) wheresome pre-installed Java installations exist.

When I type on a command prompt/terminal:

java -version

the output tells me if java.exe is part of a JavaSE or JavaEE installation.
But it does NOT tell me if I use

java.exe from the jdk path/part or the jre path/part.

How can I find out (in Win) WHICH java.exe I used in detail?

Keep in mind that there could be further applications/developments tool which might bring their own
jdk/jre installation.

So java.exe could be called from these additional installations as well.

Robin

Something like http://www.flounder.com/whereis.htm ?
 
M

markspace

How can I find out (in Win) WHICH java.exe I used in detail?

It's "where java" on windows, and I think whereis on *nix.

If you mean programatically, just access the class/sdk component or
other service. If you get an exception, it wasn't installed. Some
programs (like ant) require you to set the JAVA_HOME environment
variable to identify which SDK you want to use (some users have more
than one). I prefer using command line arguments or cofig files;
polluting the environment with lots of tedious variables is a last resort.
 
L

Luuk

Assume I am working on a unknown computer (from a friend/colleague) where some pre-installed Java installations exist.

When I type on a command prompt/terminal:

java -version

the output tells me if java.exe is part of a JavaSE or JavaEE installation.
But it does NOT tell me if I use

java.exe from the jdk path/part or the jre path/part.

How can I find out (in Win) WHICH java.exe I used in detail?

Keep in mind that there could be further applications/developments tool which might bring their own
jdk/jre installation.

So java.exe could be called from these additional installations as well.

Robin

I knew there was a tool called WHEREIS.EXE but thats very old....

After looking a bit furthere i found this site:
http://blogs.msdn.com/b/oldnewthing/archive/2005/01/20/357225.aspx

If you create a batchfile (whereis.bat) with the following (on one line!):
@for %%e in (%PATHEXT%) do @for %%i in (%1%%e) do @if NOT
"%%~$PATH:i"=="" echo %%~$PATH:i

tha you could do:
C:\>whereis.bat java
C:\Windows\System32\java.exe

hmmmm, who dit put this java stuff in my windows-folder..... ;(
 
L

Luuk

I knew there was a tool called WHEREIS.EXE but thats very old....

After looking a bit furthere i found this site:
http://blogs.msdn.com/b/oldnewthing/archive/2005/01/20/357225.aspx

If you create a batchfile (whereis.bat) with the following (on one line!):
@for %%e in (%PATHEXT%) do @for %%i in (%1%%e) do @if NOT
"%%~$PATH:i"=="" echo %%~$PATH:i

tha you could do:
C:\>whereis.bat java
C:\Windows\System32\java.exe

hmmmm, who dit put this java stuff in my windows-folder..... ;(

oops, it was a multi-post....
so, indeed WHERE (like markspace suggested) would be better!
 
S

Steve

How can I find out (in Win) WHICH java.exe I used in detail?

I find cygwin a very handy tool when programming on windows. The basic
installation is very quick to download and install. Even faster is the
GNU Utilities ( *nix commands/programs ported to window ). I just put
them in a C:\Util folder and put that in my path.

Once you have either of those set up all you need to do is type this at
a command prompt:

which java
 
L

Lew

Steve said:
I find cygwin a very handy tool when programming on windows. The basic
installation is very quick to download and install. Even faster is the
GNU Utilities ( *nix commands/programs ported to window ). I just put
them in a C:\Util folder and put that in my path.

Once you have either of those set up all you need to do is type this at
a command prompt:

which java

Cygwin and "which" were suggested to him early on, in his other multipost. This is an example of why multiposting is bad.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,735
Latest member
HikmatRamazanov

Latest Threads

Top