如何在 Eclipse 的编译器列表中添加 JDK 7

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

How to add JDK 7 in compiler list in eclipse

eclipserational-rsa

提问by Ashish

I have installed the JDK7 on my machine and I want it to add in the list of compiler enter image description here

我已经在我的机器上安装了 JDK7,我希望将它添加到编译器列表中 在此处输入图片说明

I have tried adding JDK 7 in the list of installed JRE but it is still not appearing in the list of compiler compliance level.enter image description here

我尝试在已安装的 JRE 列表中添加 JDK 7,但它仍然没有出现在编译器合规级别列表中。在此处输入图片说明

Could any one tell me how can I add JDK 7 into new compliance level.

谁能告诉我如何将 JDK 7 添加到新的合规性级别。

回答by giampaolo

Eclipse uses its own compiler (see What is the difference between javac and the Eclipse compiler?), so you won't find it if you use an old version of Eclipse (as probably your RSA is based on). Java 7 support is available for Eclipse 3.7.1 or higher (at the moment current stable is 4.2).

Eclipse 使用它自己的编译器(请参阅javac 和 Eclipse 编译器之间的区别是什么?),因此如果您使用旧版本的 Eclipse(因为您的 RSA 可能基于它),您将找不到它。Java 7 支持可用于 Eclipse 3.7.1 或更高版本(目前稳定版本为 4.2)。

However, if you want to keep that version of Eclipse, you can create a new Builder using your JDK7 as base. To do this, go to Project and add a new Builder specifying where the javac is and the other options.

但是,如果您想保留该版本的 Eclipse,您可以使用 JDK7 作为基础创建一个新的构建器。为此,请转到 Project 并添加一个新的构建器,指定 javac 的位置和其他选项。

Look also at this question: Eclipse 3.5 and Java 7

也看看这个问题:Eclipse 3.5 and Java 7

回答by Lee Meador

Looks like you have to use the 3.8 version of eclipse to get Java 7 support. But I noticed that some later versions of 3.7.x might have it too.

看起来您必须使用 3.8 版本的 eclipse 才能获得 Java 7 支持。但我注意到 3.7.x 的某些更高版本可能也有它。

See this for features:

请参阅此功能:

http://www.eclipse.org/jdt/ui/r3_8/Java7news/whats-new-java-7.html

http://www.eclipse.org/jdt/ui/r3_8/Java7news/whats-new-java-7.html