Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
294 views
in Technique[技术] by (71.8m points)

java - Mac OS X上的Java安装位置在哪里?(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.

(我刚刚从下载在Mac OS 10.7.5的Java 7u17 这里 ,然后安装成功。)

In order to do some JNI programming, I need to know where Java installed on my Mac.

(为了做一些JNI编程,我需要知道在Mac上安装Java的位置。)

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.

(我认为在/Library/Java/JavaVirtualMachines/文件夹中,会有一个名为1.7.0.jdk的文件夹,但后来我发现该文件夹是空的。)

This was confirmed by running ls /Library/Java/JavaVirtualMachines/ in the Terminal.

(通过在终端中运行ls /Library/Java/JavaVirtualMachines/来确认这一点。)

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?

(有人可以告诉我Mac上安装Java的位置吗?)

  ask by Thunderforge translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

(在终端shell上使用/usr/libexec/java_home -v 1.8命令来确定java 1.8主目录的位置)

If you just want to find out the home directory of your most recent version of java, omit the version.

(如果您只想查找最新版本java的主目录,请省略该版本。)

eg /usr/libexec/java_home

(例如/usr/libexec/java_home)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...