Eclipse Oxygen.1 on MacOS fails at startup with Java 9 as system default

I’m a few days late to the Java 9 party, but installing Eclipse Oxygen after installing Java 9 on MacOS, I get this:

Looking in the .log file:

java.lang.NoClassDefFoundError: javax/annotation/PreDestroy
 at org.eclipse.e4.core.internal.di.InjectorImpl.disposed(InjectorImpl.java:450)
 at org.eclipse.e4.core.internal.di.Requestor.disposed(Requestor.java:156)
...snip...
Caused by: java.lang.ClassNotFoundException: javax.annotation.PreDestroy cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418
 at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:433)

Following instructions here, I added:

--add-modules=ALL-SYSTEM

Now Eclipse starts up, but adding Java 9 path on MacOS as /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home, Eclipse doesn’t want to see this as a valid jdk:

Continuing to follow the instructions, installing the Java 9 Support plugin from:

https://marketplace.eclipse.org/content/java-9-support-oxygen/

This still didn’t help but pressing the ‘Search’ button finds the Java 9 install and adds it to the list, which is odd because it points to exactly the same path:

At this point, things are still not good, as the System Libraries are not picked up:

It looks like official support is coming in the 4.7.1a release due on 10/11/17. Maybe at this point it’s best to wait for the official release.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.