如何在 Mac 上将 Java 7 JRE 添加到 Eclipse?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12426985/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 18:59:04  来源:igfitidea点击:

How do I add the Java 7 JRE to Eclipse on my mac?

eclipsejava

提问by Nosrettap

I have a mac and I recently installed Java 7 on it. However, my question is, how do I let Eclipse (Juno) know about this installation. I went to the preferences menu and selected Java > Installed JREs to get to this screen

我有一台 mac,我最近在上面安装了 Java 7。但是,我的问题是,如何让 Eclipse (Juno) 知道此安装。我转到首选项菜单并选择 Java > Installed JREs 进入此屏幕

enter image description here

在此处输入图片说明

I've clicking the add button but I'm not sure what I need to add:

我点击了添加按钮,但我不确定我需要添加什么:

enter image description here

在此处输入图片说明

I would have thought that I should add the .jdk file but it eclipse doesn't like that.

我本以为我应该添加 .jdk 文件,但它 eclipse 不喜欢那样。

回答by steffan

For the latest version (07) you can type in /Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk/Contents/Home/ instead of using the directory... button

对于最新版本 (07),您可以输入 /Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk/Contents/Home/ 而不是使用目录...按钮