I replaced the HDD of the desktop with SSD, so I was building the environment. Java 9 was officially released, and when I tried to create an environment with Java 9 + eclipse 4.7, it broke at startup.
https://wiki.eclipse.org/Configure_Eclipse_for_Java_9
Users who install Eclipse Oxygen 4.7.1a are able to launch with Java 9 and get Java 9 support, and the configuration described below won't be necessary anymore. There might be cases which won't work, see item 3 below in that case.
So let's install eclipse 4.7.1a or later
https://wiki.eclipse.org/Configure_Eclipse_for_Java_9
It was written to add --add-modules = ALL-SYSTEM
to.
(2017/10/02) It worked without any problem, so I fixed it.
TL;DR
Add --add-modules = ALL-SYSTEM
to -vmargs in eclipse.ini.
eclipse.ini
-vmargs
--add-modules=ALL-SYSTEM
OS: Windows8.1 64bit JDK: Java SE Development Kit 9 eclipse: Oxygen Release (4.7.0)
-> Leave default
> java -version
java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
-> Set jdk path with -vm in eclipse.ini
eclipse.ini
-vm
C:\Program Files\Java\jdk-9\bin\javaw.exe
-> I got an error
.log
!SESSION 2017-09-24 20:47:30.135 -----------------------------------------------
eclipse.buildId=4.7.0.I20170612-0950
java.version=9
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=ja_JP
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.osgi 4 0 2017-09-24 20:47:33.101
!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)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:318)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
...Abbreviation...
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)
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)
... 25 more
!ENTRY org.eclipse.e4.ui.workbench 4 0 2017-09-24 20:47:33.117
!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)
...Abbreviation...
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)
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
--add-modules = ALL-SYSTEM
to -vmargs in eclipse.inieclipse.ini
-vmargs
-Dosgi.requiredJavaVersion=1.8
[email protected]/eclipse-workspace
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Dosgi.requiredJavaVersion=1.8
-Xms256m
-Xmx1024m
-Declipse.p2.max.threads=10
-Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest
-Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/
+ --add-modules=ALL-SYSTEM
-> You started it
https://wiki.eclipse.org/Configure_Eclipse_for_Java_9 https://www.eclipse.org/eclipse/news/4.6/platform.php#java-9 https://issues.jboss.org/browse/JBIDE-22417?focusedCommentId=13310535&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel&_sscc=t#comment-13310535