Question Locked

Where is Java Installed on Mac OS X?

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi

I just downloaded Java 7u17 on Mac OS 10.7.5 then successfully installed it. In order to do some JNI programming, I need to know where Java installed on my Mac.

I thought that inside the /Library/Java/JavaVirtualMachines/ folder, there would be a folder called 1.7.0.jdk or something, but then I found that the folder is empty. This was confirmed by running ls /Library/Java/JavaVirtualMachines/ in the Terminal. I've tried searching for it to find out if it was installed somewhere else, but that doesn't seem to be turning anything up.

Could someone please tell me where Java is installed on my Mac?

5 replies

by old molases

Use /usr/libexec/java_home -v 1.8 command on a terminal shell to figure out where is your Java 1.8 home directory

If you just want to find out the home directory of your most recent version of Java, omit the version. e.g. /usr/libexec/java_home

by aviator.lotions0i

if you're not a developer, you most probably will never come into the situation that you won't find any java on your mac. If an app needs java, it will install java.

by wilsonhenry13463 edited

Use /usr/libexec/java_home -v 1.8 is to find out where your Java 1.8 home directory is.

by ready.09whippet

I got to this question because I was getting an error in eclipse on my mac because I was getting an error on the first line of the program "import java.util.*." I strongly suspect this is because the java path isn't set correctly or something (even though I set this up once before). I entered the command in this answer and I get a directory. Can I just paste that directory into the textbox in the "Native library folder config" window? Or does this directory belong somewhere else?

This discussion is closed to new replies.