Eclipse Oxygen can not be opened using Java 9

3

On September 21, 2017, Java 9 officially appeared. I want to try what new Java offers, mainly that acclaimed system of modules. I just installed Oracle JDK 9 on my computer and Eclipse Oxygen that has a plugin to support the development in Java 9 (as of September 22, 2017 in beta). All right, I installed the tools, but when I run the Eclipse I see an error message appears and I can not see my workspace. Here the image of the message:

I try to see the content of the error message but I find it very strange what it says:

  

! ENTRY org.eclipse.e4.ui.workbench 4 0 2017-09-22 01: 30: 39,845   ! MESSAGE FrameworkEvent ERROR! STACK 0 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)           at org.eclipse.e4.core.internal.contexts.ContextObjectSupplier $ ContextInjectionListener.update (ContextObjectSupplier.java:78)           at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update (TrackableComputationExt.java:111)           at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.handleInvalid (TrackableComputationExt.java:74)           at org.eclipse.e4.core.internal.contexts.EclipseContext.dispose (EclipseContext.java:178)           at org.eclipse.e4.core.internal.contexts.osgi.EclipseContextOSGi.dispose (EclipseContextOSGi.java:99)           at org.eclipse.e4.core.internal.contexts.osgi.EclipseContextOSGi.bundleChanged (EclipseContextOSGi.java:141)           at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent (BundleContextImpl.java:908)           at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent (EventManager.java:230)           at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous (ListenerQueue.java:148)           at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged (EquinoxEventPublisher.java:213)           at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent (EquinoxEventPublisher.java:120)           at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent (EquinoxEventPublisher.java:112)           at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent (EquinoxContainerAdaptor.java:168)           at org.eclipse.osgi.container.Module.publishEvent (Module.java:476)           at org.eclipse.osgi.container.Module.doStop (Module.java:634)           at org.eclipse.osgi.container.Module.stop (Module.java:498)           at org.eclipse.osgi.container.SystemModule.stop (SystemModule.java:202)           at org.eclipse.osgi.internal.framework.EquinoxBundle $ SystemBundle $ EquinoxSystemModule $ 1.run (EquinoxBundle.java:165)           at java.base / java.lang.Thread.run (Thread.java:844) Caused by: java.lang.ClassNotFoundException: javax.annotation.PreDestroy can not   be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418           at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal (BundleLoader.java:433)           at org.eclipse.osgi.internal.loader.BundleLoader.findClass (BundleLoader.java:395)           at org.eclipse.osgi.internal.loader.BundleLoader.findClass (BundleLoader.java:387)           at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass (ModuleClassLoader.java:150)           at java.base / java.lang.ClassLoader.loadClass (ClassLoader.java:496)           ... 21 more

What can I do to run Eclipse with JDK 9 installed on my computer?

    
asked by 22.09.2017 в 08:36
source

1 answer

3

Regardless of the operating system, what you should do is locate the file eclipse.ini 1 of your Eclipse installation and add the following line:

--add-modules=java.se.ee

With this you can run Eclipse without problems, but with the elementary packages to run a Java console application.

To be able to implement any type of Java application with Eclipse, you can add the following configuration:

--add-modules=ALL-SYSTEM

Source: link

1 On Windows and Linux, the eclipse.ini file is located in the eclipse installation folder. In MacOS, the eclipse.ini file is located inside Eclipse.app/Contents/Eclipse.

    
answered by 22.09.2017 в 08:36