Where is Java Installed on Mac OS X?

I just downloaded Java 7u17 on Mac OS 10.7.5 from here and 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?


在终端shell上使用/usr/libexec/java_home -v 1.7命令来确定你的java 1.7主目录在哪里


Turns out that I actually had the Java 7 JRE installed, not the JDK. The correct download link is here. After installing it, jdk1.7.0jdk appears in the JavaVirtualMachines directory.


您可以在终端中使用echo $(/usr/libexec/java_home)命令来了解Java安装的路径。

链接地址: http://www.djcxy.com/p/13364.html

上一篇: 为什么JavaScript中有一个`null`值?

下一篇: Java在Mac OS X上安装在哪里?