如何使Eclipse Oxygen在Java 9上运行 [英] How to get Eclipse Oxygen to run on Java 9

查看:228
本文介绍了如何使Eclipse Oxygen在Java 9上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拼命尝试让Eclipse Oxygen在Mac OSX上运行Java 9,但是我似乎以某种方式失败了.

I desperately try to get Eclipse Oxygen to run Java 9 on Mac OSX, but I somehow seem to fail.

到目前为止我已经完成的步骤:

Steps I have done so far:

  • 在/Library/Java/JavaVirtualMachines/jdk-9.jdk(已安装的/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk旁边)中安装了Java 9 JDK

  • Installed the Java 9 JDK in /Library/Java/JavaVirtualMachines/jdk-9.jdk (next to the already installed /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk)

从Eclipse市场安装了适用于Oxygen 4.7的Java 9支持(BETA)"插件(我安装了适用于Java EE开发人员的Oxygen 4.7)

Installed the "Java 9 Support (BETA) for Oxygen 4.7" plugin from the Eclipse market place (I have Oxygen 4.7 for Java EE Developers installed)

在eclipse.ini中的-vmargs行之后添加"--add-modules = java.se.ee"行(如此处建议:)以避免启动问题

Added the line "--add-modules=java.se.ee" after the -vmargs line in eclipse.ini (as suggested here: With java 9 ea, Eclipse fails to install and show error "An error has occurred, see the log file null") to avoid startup problems

在设置中将编译器"符合级别设置为"9(BETA)"

Set the Compiler compliance level in the settings to "9 (BETA)"

将Java 9 SDK添加到已安装的JRE中,并使其成为默认选择

Added the Java 9 SDK to the installed JREs and made it the default choice

现在,在程序启动时,我将打印所有System.getProperty()值.例如,我得到

Now, at the startup of my program, I print out all the System.getProperty() values. And I get for example

  • java.runtime.version:1.8.0_144-b01

  • java.runtime.version: 1.8.0_144-b01

java.specification.version:1.8

java.specification.version: 1.8

java.vm.specification.version:1.8

java.vm.specification.version: 1.8

java.version:1.8.0_144

java.version: 1.8.0_144

为什么?!还有什么要告诉Eclipse,为了上帝的缘故,它不应该使用Java 8,而是要使用Java 9?

Why?! What else is there to do to tell Eclipse that it shall for gods sake not use Java 8 but Java 9?

我需要Java 9的原因之一是针对TLS的新安全功能OCSP装订(请参见

One reason I need Java 9 is the new security feature OCSP Stapling for TLS (see https://docs.oracle.com/javase/9/security/java-pki-programmers-guide.htm#JSSEC-unique_4307382).

有一个系统属性"jdk.tls.server.enableStatusRequestExtension",当当前查询该属性时,它返回"null",但在Java 9中应该返回"false":

There is the system property "jdk.tls.server.enableStatusRequestExtension" which, when currently queried, returns "null", but it should return "false" with Java 9:

getLogger().debug("enableStatusRequestExtension: " + System.getProperty("jdk.tls.server.enableStatusRequestExtension"));

希望您能在这里为我提供帮助.

I hope you can help me here.

推荐答案

要使用Java 9运行程序,请执行以下操作:

To run your program using Java 9 do the following:

打开偏好设置",然后转到"Java>已安装的JRE".如果缺少Java 9 JDK,请添加它.

Open the Preferences and go to 'Java > Installed JREs'. Add the Java 9 JDK if it is missing.

在Java项目的属性中,选择"Java构建路径"条目,然后选择库"选项卡.编辑"JRE系统库"条目,然后选择Java 9 JDK或Java 9 Execution环境.

In the Properties for the Java project select the 'Java Build Path' entry and choose the 'Libraries' tab. Edit the 'JRE System Library' entry and choose the Java 9 JDK or a Java 9 Execution environment.

您还需要查看程序的运行配置"(运行>运行配置").检查JRE设置是项目执行环境"还是Java 9 JDK/执行环境.

You also need to look at the 'Run Configuration' for your program ('Run > Run Configurations'). Check that JRE setting is 'Project execution environment' or a Java 9 JDK / Execution environment.

这篇关于如何使Eclipse Oxygen在Java 9上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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