将Java SE 6设置为OSX Eclipse中的执行环境 [英] Setup Java SE 6 as execution environment in OSX Eclipse

查看:381
本文介绍了将Java SE 6设置为OSX Eclipse中的执行环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的eclipse默认使用JavaSE-1.8。但是由于具体原因我想使用Java SE 6.
我已经完成了以下工作:

My eclipse currently uses JavaSE-1.8 by default. But for a specific reason I want to use Java SE 6. I have done the following:


  1. 我的项目 - >配置构建路径 - > Java编译器 - >编译器合规级别 - > 1.6

  1. My Project -> configure build path -> Java compiler -> Compiler compliance level -> 1.6

项目 - >属性 - >库 - >删除1.8和添加库 - >替代JRE - > ..?

Project -> properties -> Libraries -> remove 1.8 and Add Library -> Alternate JRE -> .. ?

在下拉菜单中,只有1.8可用。
如何在我的eclipse中设置Java SE 1.6作为默认运行时环境?
另外,在oracle的存档部分链接我无法找到1.6版本。我从哪里下载JRE 1.6?
我从哪里下载?

Under the dropdown, only 1.8 is available. How do I setup Java SE 1.6 in my eclipse as default runtime environment ? Also, under the archive section of oracle link I am unable to find a version for 1.6. Where do I download JRE 1.6 from ? where do I download it from ?

推荐答案

最佳做法是使用执行环境 1 ,而不是直接引用系统上安装的JRE。执行环境是安装的JRE的抽象,允许在不知道JRE的安装细节的情况下配置项目。

The best practice is to use Execution Environments1, not direct references to JREs installed on your system. Execution Environment is an abstraction of installed JREs that allow projects to be configured without knowing the details of what JREs are installed.

要在Eclipse中设置JRE,请转到首选项> Java>已安装的JRE并按照说明设置备用(在你的情况下为1.6)JRE / JDK。一旦设置了1.6 JRE,请转到首选项中的执行环境子页面,并将其标记为 JavaSE-1.6 执行环境的默认值。

To set up a JRE in Eclipse, go to the Preferences > Java > Installed JREs and follow the instructions to set up the alternate (1.6 in your case) JRE/JDK. Once you have your 1.6 JRE set up, go to the Execution Environments sub-page in the preferences and mark it as the default for the JavaSE-1.6 Execution Environment.

现在,回到项目的Build Path属性,在下,选择 JRE系统库,然后使用编辑... 按钮;您可以选择您刚刚配置的执行环境 JavaSE-1.6

Now, back in your project's Build Path properties, under Libraries, select the JRE System Library and use the Edit... button; there you can choose the Execution Environment JavaSE-1.6 that you just configured.

您可以从Apple下载legacyJava 1.6 JRE here 。但请注意,这样做可能会使整个操作系统成为默认的JRE,这对大多数人来说是不可取的。

You can download "legacy" Java 1.6 JRE from Apple here. But beware that doing so might make it the default JRE for your entire OS, which isn't likely to be desirable for most people.

1 该页面上的某些内容特定于插件开发,但执行环境的概念适用于Eclipse中的任何Java项目。只需忽略有关OSGi和插件开发(PDE)的部分。

1Some content on that page is specific to plug-in development, but the concepts of Execution Environments apply to any Java project in Eclipse. Just ignore the parts about OSGi and Plug-in Development (PDE).

这篇关于将Java SE 6设置为OSX Eclipse中的执行环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆