问题描述
我刚从这里然后成功安装它。为了做一些JNI编程,我需要知道在Mac上安装Java的位置。
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.
我认为在 / Library / Java / JavaVirtualMachines /
文件夹中,会有一个名为<$的文件夹c $ c> 1.7.0.jdk 或其他什么,但后来我发现文件夹是空的。通过在终端中运行 ls / Library / Java / JavaVirtualMachines /
来确认这一点。我已经尝试搜索它,看看它是否安装在其他地方,但这似乎没有改变任何东西。
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.
有人可以告诉我在哪里Java安装在我的Mac上?
Could someone please tell me where Java is installed on my Mac?
推荐答案
使用 / usr / libexec / java_home -v 1.7 终端shell上的code>命令,用于确定java 1.7主目录的位置
Use /usr/libexec/java_home -v 1.7
command on a terminal shell to figure out where is your java 1.7 home directory
如果您只是想查找最新版本的主目录的java,省略版本。例如 / usr / libexec / java_home -v
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 -v
这篇关于Mac OS X上的Java安装位置在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!