Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Where is OS X's Java VM?

Where is OS X's Java VM?
Thread Tools
OliverTwist
Fresh-Faced Recruit
Join Date: Aug 2007
Status: Offline
Reply With Quote
Jan 30, 2008, 08:05 PM
 
Simple question here,

Which directory is the Java VM in? On Windows, it's simply C: \Windows\System32\java.exe, but on OS X I'm not so sure. I need to know for piece of software I'm designing, which requires the absolute path to the Java VM on each platform. Thanks.
     
OliverTwist  (op)
Fresh-Faced Recruit
Join Date: Aug 2007
Status: Offline
Reply With Quote
Jan 30, 2008, 08:20 PM
 
Well it looks like I found it myself. It's hidden in the usr/bin/ directory.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Jan 30, 2008, 09:01 PM
 
which java

will reveal the path to the Java binary,

which javac

will reveal the path to the Java compiler
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jan 31, 2008, 10:28 AM
 
The files in /usr/bin are actually just symlinks to /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands - with Current there being a symlink to your chosen Java VM version.
     
jamil5454
Mac Elite
Join Date: Oct 2004
Location: Downtown Austin, TX
Status: Offline
Reply With Quote
Feb 6, 2008, 11:53 AM
 
Originally Posted by besson3c View Post
which java

will reveal the path to the Java binary,

which javac

will reveal the path to the Java compiler
Interesting. So what's the difference between which and whereis?
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Feb 6, 2008, 12:08 PM
 
Originally Posted by jamil5454 View Post
Interesting. So what's the difference between which and whereis?
which: Checks all the directories in your PATH to find the first one containing the program you named.

whereis: Checks the standard binary directories to find the first one containing the program you named.

So, for example, I have the program git in /usr/local/bin. If I do which git, I get /usr/local/bin/git, whereas if I do whereis git, I get nothing at all.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 08:27 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,