Java 使用 JDK 1.6 设置现有的 Eclipse IDE

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

Setting up an existing Eclipse IDE with JDK 1.6

eclipsejava

提问by Gaurang Tandon

My PC : Win 7 32-bit , Eclipse Kepler

我的电脑:Win 7 32 位,Eclipse Kepler

Initially, I had JDK 1.7 . Then ,due to my project , I have to now run jdk 1.6 , which I just installed. File name :"jdk-6u25-windows-i586.exe" .I ran it and installed it in my G:// drive . Now , how do I get my Eclipse IDE to run that version (1.6) of jdk ?

最初,我有 JDK 1.7 。然后,由于我的项目,我现在必须运行刚刚安装的 jdk 1.6。文件名:“jdk-6u25-windows-i586.exe”。我运行它并将其安装在我的 G:// 驱动器中。现在,如何让我的 Eclipse IDE 运行该版本 (1.6) 的 jdk?

Thanks.

谢谢。

回答by Juned Ahsan

To setup the compiler

设置编译器

Right click on your Project->Properties->Java Compiler->Select 1.6

To set the jre:

要设置 jre:

Menu->Window->Preferences->Java->Installed JREs- > Add JDK6/jre and remove others.

回答by rocketboy

Window -> Preferences-> Java-> Installed Jres -> Add 1.6 -> select

Will set-up the global default JRE for your IDE.

将为您的 IDE 设置全局默认 JRE。

If you want to set it up on per project bases you should use:

如果你想在每个项目的基础上设置它,你应该使用:

Project Properties -> Preferences-> Java-> Installed Jres -> Add 1.6 -> select