简体   繁体   English

在OpenJDK 11上运行e(fx)clipse。WAS:在OpenJDK 11上运行Eclipse

[英]Running e(fx)clipse on OpenJDK 11. WAS: Running Eclipse on OpenJDK 11

I had Eclipse Oxygen running on Oracle's JDK 8 and that worked fine. 我让Eclipse Oxygen在Oracle的JDK 8上运行,并且运行良好。 Today I've updated my Eclipse install to the latest version, and it still worked fine. 今天,我已经将Eclipse安装更新到最新版本,并且仍然可以正常工作。

Then I installed OpenJDK 11 and JavaFX 11, and uninstalled Oracle's JDK I previously had. 然后,我安装了OpenJDK 11和JavaFX 11,并卸载了我以前拥有的Oracle JDK。 Now Eclipse won't start. 现在,Eclipse将无法启动。 I paste the last session recorded in the .log file below. 我将最后一个会话粘贴到下面的.log文件中。

Does Eclipse 2018-12 run on Open JDK 11? Eclipse 2018-12是否可以在Open JDK 11上运行? How can I do that? 我怎样才能做到这一点? The Eclipse web site does not seem to mention Open JDK 11 at all. Eclipse网站似乎根本没有提到Open JDK 11。

Update: looking more closely at the .log file it seems Eclipse is missing JavaFX. 更新:仔细查看.log文件,似乎Eclipse缺少JavaFX。 I installed JavaFX 11, including creating the environment variable PATH_TO_FX per JavaFX installation instructions. 我安装了JavaFX 11,包括按照JavaFX安装说明创建环境变量PATH_TO_FX。 Any ideas of what may be wrong? 什么可能是错的想法?

!SESSION 2019-03-14 11:20:13.073 -----------------------------------------------
eclipse.buildId=4.10.0.I20181206-0815
java.version=11.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

!ENTRY org.eclipse.e4.ui.workbench 4 0 2019-03-14 11:20:20.601
!MESSAGE Unable to create class 'org.eclipse.e4.ui.internal.workbench.ResourceHandler' from bundle '1585'
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: jdk/internal/reflect/ConstructorAccessorImpl
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:422)
    at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:333)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:193)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:108)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:77)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:59)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application.loadApplicationModel(E4Application.java:382)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:260)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:586)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:563)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:151)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1501)
Caused by: java.lang.NoClassDefFoundError: jdk/internal/reflect/ConstructorAccessorImpl
    at java.base/jdk.internal.misc.Unsafe.defineClass0(Native Method)
    at java.base/jdk.internal.misc.Unsafe.defineClass(Unsafe.java:1192)
    at java.base/jdk.internal.reflect.ClassDefiner.defineClass(ClassDefiner.java:63)
    at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:400)
    at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:394)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/jdk.internal.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:393)
    at java.base/jdk.internal.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:92)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:55)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    at java.base/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1022)
    at java.base/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1008)
    at java.base/sun.reflect.annotation.AnnotationParser$1.run(AnnotationParser.java:306)
    at java.base/sun.reflect.annotation.AnnotationParser$1.run(AnnotationParser.java:304)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/sun.reflect.annotation.AnnotationParser.annotationForMap(AnnotationParser.java:304)
    at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:294)
    at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:121)
    at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:73)
    at java.base/java.lang.reflect.Field.declaredAnnotations(Field.java:1175)
    at java.base/java.lang.reflect.Field.declaredAnnotations(Field.java:1173)
    at java.base/java.lang.reflect.Field.getAnnotation(Field.java:1142)
    at java.base/java.lang.reflect.AnnotatedElement.isAnnotationPresent(AnnotatedElement.java:274)
    at java.base/java.lang.reflect.AccessibleObject.isAnnotationPresent(AccessibleObject.java:517)
    at org.eclipse.e4.core.internal.di.InjectorImpl.isAnnotationPresent(InjectorImpl.java:1039)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processFields(InjectorImpl.java:718)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processClass(InjectorImpl.java:677)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processClassHierarchy(InjectorImpl.java:658)
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:115)
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:411)
    ... 24 more
Caused by: java.lang.ClassNotFoundException: Could not find class 'jdk.internal.reflect.ConstructorAccessorImpl'
    at org.eclipse.fx.osgi.fxloader.FXClassLoader.postFindClass(FXClassLoader.java:117)
    at org.eclipse.osgi.internal.loader.BundleLoader.searchHooks(BundleLoader.java:527)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:490)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 55 more
Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.eclipse.fx.osgi.fxloader.FXClassLoader.createModuleLoader(FXClassLoader.java:177)
    at org.eclipse.fx.osgi.fxloader.FXClassLoader.findClassJavaFX11(FXClassLoader.java:160)
    at org.eclipse.fx.osgi.fxloader.FXClassLoader.postFindClass(FXClassLoader.java:115)
    ... 61 more
Caused by: java.lang.IllegalArgumentException: Module javafx.base not known to this layer
    at java.base/java.lang.ModuleLayer.findLoader(ModuleLayer.java:885)
    ... 67 more

!ENTRY org.eclipse.epp.logging.aeri.ide 2 0 2019-03-14 11:20:20.751
!MESSAGE Could not resolve module: org.eclipse.epp.logging.aeri.ide [1639]
  Unresolved requirement: Import-Package: org.apache.lucene.document; version="[7.1.0,8.0.0)"


!ENTRY org.eclipse.osgi 4 0 2019-03-14 11:20:20.770
!MESSAGE Application error
!STACK 1
java.lang.NullPointerException
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application.loadApplicationModel(E4Application.java:385)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:260)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:586)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:563)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:151)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1501)

By looking more closely at the log file I suspected the e(fx)clipse plugin was causing the problem: 通过更仔细地查看日志文件,我怀疑e(fx)clipse插件引起了问题:

at org.eclipse.fx.osgi.fxloader.FXClassLoader.createModuleLoader(FXClassLoader.java:177)

And indeed, I found this thread on the e(fx)clipse forum with a similar report, and an answer by one of the developers that this was a bug on version 3.3.0 and that they would try to release 3.5.0 as soon as possible which had a fix. 事实上,我发现这个线程在E(FX)clipse论坛,类似的报告,并回答由开发商,这是在3.3.0版中的错误之一,他们将设法尽快释放3.5.0尽可能解决。 However, it seems that has not happened as of today. 但是,到目前为止似乎还没有发生。

So I reverted to JDK 8, uninstalled the e(fx)clipse, and now my Eclipse install works with OpenJDK 11. 因此,我恢复为JDK 8,卸载了e(fx)clipse,现在我的Eclipse安装可与OpenJDK 11一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM