将 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
upgrade eclipse to java 8
提问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 Preference
and choose Java | Installed JREs
. Then click search
it would show JAVA SE 8 if you have already installed JAVA SDK 8.
在 OS X 中,转到Preference
并选择Java | Installed JREs
。search
如果您已经安装了 JAVA SDK 8,然后单击它会显示 JAVA SE 8。