本文介绍了Java 在 Mac OS X 上安装在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚从 这里下载了 Mac OS 10.7.5 上的 Java 7u17 然后就安装成功了.为了进行一些 JNI 编程,我需要知道 Java 在我的 Mac 上的安装位置.

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/ 文件夹中,会有一个名为 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?

推荐答案

在终端 shell 上使用 /usr/libexec/java_home -v 1.8 命令找出您的 Java 1.8 在哪里 主目录

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

如果您只想找出最新 Java 版本的主目录,请忽略版本.例如/usr/libexec/java_home

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

这篇关于Java 在 Mac OS X 上安装在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 12:00