霓虹灯:如何在 jdk9 上运行? [英] Neon: how to run on jdk9?

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

问题描述

刚开始玩 jdk9 - 一开始就卡住了:

Just started playing with jdk9 - and kind-of stuck right at the beginning:

  • 下载并解压 eclipse-java-neon-m4a-win32
  • 已安装 Java 9 支持(来自 marketplace 的 dnd)
  • 下载并安装了 jdk9u99(只有 jdk,没有公共 jre)

此时,我可以使用 jre/jdk(在 eclipse.ini 中使用/输出 vm 参数)并使用 java 9 支持在我的默认 java(即 8u60)上运行 eclipse.

At this point, I can run eclipse on my default java (which is 8u60) both with jre/jdk (with/out vm argument in eclipse.ini) and use the java 9 support.

下一步,我想用 java 9 运行 eclipse:将 vm-arg 添加到 eclipse.ini,现在 eclipse 中止其启动并显示冗长的错误日志(ini 和 log 均如下所示).

As next step, I wanted to run eclipse with java 9: added the vm-arg to eclipse.ini, now eclipse aborts its startup with a lengthy error log (both ini and log are shown below).

问题出在哪里?

我的ini:

-startup
plugins/org.eclipse.equinox.launcher_1.3.200.v20151021-1308.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.300.v20151013-1129
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
d:javajdk190_eainjavaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Xms256m
-Xmx1024m

错误日志的顶部(> 900k)

The top of the error log (it's > 900k)

!SESSION 2016-01-22 14:31:55.974 -----------------------------------------------
eclipse.buildId=4.6.0.I20151209-2300
java.version=9-ea
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product

!ENTRY org.eclipse.equinox.common 4 0 2016-01-22 14:31:57.113
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.equinox.common [143]
  Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.7))"

    at org.eclipse.osgi.container.Module.start(Module.java:429)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.eclipse.ant.core 4 0 2016-01-22 14:31:57.175
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.ant.core [61]
  Unresolved requirement: Require-Bundle: org.eclipse.core.variables; bundle-version="[3.1.0,4.0.0)"
    -> Bundle-SymbolicName: org.eclipse.core.variables; bundle-version="3.2.800.v20130819-1716"; singleton:="true"
       org.eclipse.core.variables [88]
         Unresolved requirement: Require-Bundle: org.eclipse.core.runtime; bundle-version="[3.3.0,4.0.0)"
           -> Bundle-SymbolicName: org.eclipse.core.runtime; bundle-version="3.12.0.v20151104-0048"; singleton:="true"
              org.eclipse.core.runtime [87]
                Unresolved requirement: Require-Bundle: org.eclipse.equinox.common; bundle-version="[3.8.0,4.0.0)"; visibility:="reexport"
                  -> Bundle-SymbolicName: org.eclipse.equinox.common; bundle-version="3.8.0.v20151023-1114"; singleton:="true"
                     org.eclipse.equinox.common [143]
                       Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.7))"

    at org.eclipse.osgi.container.Module.start(Module.java:429)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

<小时>

更新

最新的 Neon (M6) 和 9-ea-113 仍然不走运,但记录的错误已更改

still no luck with the latest Neon (M6) and 9-ea-113, the logged error has changed, though

!SESSION 2016-04-28 16:27:53.344 -----------------------------------------------
eclipse.buildId=4.6.0.I20160317-0200
java.version=9-ea
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product

!ENTRY org.eclipse.osgi 4 0 2016-04-28 16:28:10.145
!MESSAGE Application error
!STACK 1
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:386)
    at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:294)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultHeadlessContext(E4Application.java:490)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultContext(E4Application.java:504)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:203)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:627)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:605)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:520)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:670)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:609)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1516)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1489)
Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
    at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:151)
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:375)
    ... 23 more

看起来与错误报告中的类似.它在 M7 中被标记为固定.

Which looks similar to the one in a bug report. It's marked as fixed in M7.

推荐答案

您可以下载支持 Java 9 的最新版本 eclipse - https://www.eclipse.org/downloads/eclipse-packages/

<小时>

我正在运行 Java(TM) SE 运行时环境 (build 9-ea+158) 和 eclipse 版本:Neon.2 Release (4.6.2) - 版本 ID:20161208-0600

You can download the latest version of eclipse which has support for Java 9 - https://www.eclipse.org/downloads/eclipse-packages/


I am running Java(TM) SE Runtime Environment (build 9-ea+158) and eclipse Version: Neon.2 Release (4.6.2) - Build id: 20161208-0600

-Djdk.launcher.addmods=-addmods 以某种方式使用值 java.se.eejava 的解决方案.annotations.common 不起作用.

Somehow the solutions with -Djdk.launcher.addmods= and -addmods using values java.se.ee or java.annotations.common did not work.

以下是对我有用的解决方案:

--add-modules=java.se.ee

来源:https://issues.jboss.org/browse/JBIDE-22417?focusedCommentId=13310535&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-153<13310/a>

Source: https://issues.jboss.org/browse/JBIDE-22417?focusedCommentId=13310535&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13310535

这篇关于霓虹灯:如何在 jdk9 上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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