将 Eclipse 升级到 Java 8

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22619262/
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-08-13 16:54:11  来源:igfitidea点击:

upgrade eclipse to java 8

javaeclipsejava-8upgrade

提问by Andisheh Keikha

I am trying to update my eclipse environment to java 8. I installed the jdk and jre version 8. I also did this:

我正在尝试将我的 eclipse 环境更新为 java 8。我安装了 jdk 和 jre 版本 8。我也这样做了:

https://wiki.eclipse.org/JDT/Eclipse_Java_8_Support_For_Kepler

https://wiki.eclipse.org/JDT/Eclipse_Java_8_Support_For_Kepler

then in project -> properties -> java build path -> JRE system libraries -> edit -> execution environment -> JavaSE-1.8(unbound) which is the only option that has java 8 in its name. but when I select it it says : No JREs in workspace compatible with specified execution environment: JavaSE-1.8

然后在项目 -> 属性 -> java 构建路径 -> JRE 系统库 -> 编辑 -> 执行环境 -> JavaSE-1.8(未绑定)这是名称中包含 java 8 的唯一选项。但是当我选择它时,它说:工作区中没有与指定执行环境兼容的 JRE:JavaSE-1.8

采纳答案by Dawood ibn Kareem

Go to Window | Preferences. Then under Java | Installed JREs, click "Add", click "Standard VM", then "Next", then "Directory", and find the location where you installed JDK 1.8.

Window | Preferences。然后在Java | Installed JREs,单击"Add",单击"Standard VM",然后"Next",然后"Directory",然后找到您安装的位置JDK 1.8

Lastly, make sure the checkbox next to it, on the list of installed JREs, is switched on.

最后,确保已安装 JRE 列表中它旁边的复选框已打开。

回答by fayt

I would like to precise something. If you installed java8 with apt-get like me, the jdk is add to /usr/lib/jvm.

我想精确一些。如果你像我一样用 apt-get 安装了 java8,jdk 会被添加到 /usr/lib/jvm。

回答by Fantasy Fang

In OS X, go to Preferenceand choose Java | Installed JREs. Then click searchit would show JAVA SE 8 if you have already installed JAVA SDK 8. enter image description here

在 OS X 中,转到Preference并选择Java | Installed JREssearch如果您已经安装了 JAVA SDK 8,然后单击它会显示 JAVA SE 8。 在此处输入图片说明