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

时间:2019-03-14 18:26:55

标签: java eclipse efxclipse

我在Oracle JDK 8上运行了Eclipse Oxygen,并且运行良好。今天,我已经将Eclipse安装更新到最新版本,并且仍然可以正常工作。

然后,我安装了OpenJDK 11和JavaFX 11,并卸载了我以前拥有的Oracle JDK。现在,Eclipse将无法启动。我将记录的最后一个会话粘贴到下面的.log文件中。

Eclipse 2018-12是否可以在Open JDK 11上运行?我怎样才能做到这一点? Eclipse网站似乎根本没有提到Open JDK 11。

更新:更仔细地查看.log文件,看来Eclipse缺少JavaFX。我安装了JavaFX 11,包括按照JavaFX安装说明创建环境变量PATH_TO_FX。对可能有什么问题的任何想法吗?

!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)

1 个答案:

答案 0 :(得分:0)

通过更仔细地查看日志文件,我怀疑e(fx)clipse插件引起了问题:

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

确实,我在e(fx)clipse论坛上发现了this thread,并得到了类似的报告,并且一位开发人员回答说这是版本3.3.0的错误,他们将尝试尽快发布3.5.0并已修复。但是,到目前为止似乎还没有发生。

所以我恢复为JDK 8,卸载了e(fx)clipse,现在我的Eclipse安装可与OpenJDK 11一起使用。