2

I had Eclipse Oxygen running on Oracle's JDK 8 and that worked fine. Today I've updated my Eclipse install to the latest version, and it still worked fine.

Then I installed OpenJDK 11 and JavaFX 11, and uninstalled Oracle's JDK I previously had. Now Eclipse won't start. I paste the last session recorded in the .log file below.

Does Eclipse 2018-12 run on Open JDK 11? How can I do that? The Eclipse web site does not seem to mention Open JDK 11 at all.

Update: looking more closely at the .log file it seems Eclipse is missing JavaFX. I installed JavaFX 11, including creating the environment variable PATH_TO_FX per JavaFX installation instructions. 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)
user118967
  • 4,895
  • 5
  • 33
  • 54
  • 1
    I can say that the Eclipse 2018-12 does run with openjdk 11 -- we have it running with that approach on multiple operating systems. Did you try launching against a completely empty workspace? – KevinO Mar 14 '19 at 18:28
  • I hadn't, but did now and got the same thing. Incidentally, this made me realize I hadn't copied the entire relevant portion of .log, which I updated now in the question. It seems it is crashing because it misses javafx, even though I have installed it according to JavaFX's instructions, including creating the environment variable PATH_TO_FX. So not sure why that doesn't work. – user118967 Mar 14 '19 at 18:37
  • I'm using OpenJ9 OpenJDK on Windows for Eclipse since about a year without problems. Why you add JavaFX to the JDK? It is not required to run Eclipse. Different JREs/JDKs can be used to run Eclipse and to compile/run your application. – howlger Mar 14 '19 at 18:44
  • I added JavaFX because the .log file indicates errors based on it missing. This may have to do with my workspace having plugins that use it. I am trying to start on a blank workspace but having trouble. My install started a given workspace automatically. I renamed that workspace to avoid doing that, but when I do that a new empty folder with the same name is created and there is still a crash. – user118967 Mar 14 '19 at 19:10
  • 1
    You can add `-clean` (which is probably good anyway) and `-data WORKSPACE` to specify a different location. – KevinO Mar 14 '19 at 19:14
  • Thanks @KevinO. Started with a blank workspace and got the same error. So I guess this is due to some plugin that does not work with JavaFX 11. Any way of finding out which one? – user118967 Mar 14 '19 at 20:43

1 Answers1

0

By looking more closely at the log file I suspected the e(fx)clipse plugin was causing the problem:

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. 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.

user118967
  • 4,895
  • 5
  • 33
  • 54