Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 522664 - [9] Unable to launch Eclipse runtime workbench with Java 9
Summary: [9] Unable to launch Eclipse runtime workbench with Java 9
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.8   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.7.1a   Edit
Assignee: Vikas Chandra CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 458235
  Show dependency tree
 
Reported: 2017-09-22 14:46 EDT by Noopur Gupta CLA
Modified: 2017-09-29 01:50 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Noopur Gupta CLA 2017-09-22 14:46:25 EDT
- Launch Eclipse having Java 9 support.
- Go to Run > Run Configurations...
- Create a new "Eclipse Application" launch configuration.
- Specify Java 9 as JRE for this launch configuration.
- Apply > Run.

We get this exception:

!ENTRY org.eclipse.osgi 4 0 2017-09-23 00:09:11.567
!MESSAGE Application error
!STACK 1
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:410)
...
Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:124)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:399)
	... 23 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct 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)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
Comment 1 Noopur Gupta CLA 2017-09-22 14:49:20 EDT
The fix is to manually add --add-modules=ALL-SYSTEM to VM arguments in Arguments tab of the launch configuration.

Eclipse can add it by default when JRE 9 is being used.
Comment 2 Vikas Chandra CLA 2017-09-23 09:07:44 EDT
Auto-update of gerrit patches on the bug is not happening. Hence

Fix -> https://git.eclipse.org/r/#/c/105654/
Comment 3 Eclipse Genie CLA 2017-09-23 12:49:04 EDT
Gerrit change https://git.eclipse.org/r/105654 was merged to [R4_7_maintenance].
Commit: http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=fecad192560bd365204946a1df5c58befd319bdc
Comment 4 Vikas Chandra CLA 2017-09-27 06:39:01 EDT
Verified that run/debug is launching with JavaSE9 and JDK 9 in

Version: Oxygen.1a (4.7.1a)
Build id: M20170926-1700
Comment 5 Eclipse Genie CLA 2017-09-28 05:55:35 EDT
New Gerrit change created: https://git.eclipse.org/r/105908
Comment 7 Vikas Chandra CLA 2017-09-29 01:50:47 EDT
Also verified on
Version: Photon (4.8)
Build id: I20170928-2000