Error when starting eclipse after upgrading JDK

Upgraded JDK from 8 to 11

--Uninstall Oracle JDK 8 --Install OpenJDK11 (set the bin folder in the environment variable PATH) --Install OpenJDK8 (not included in environment variable PATH)

And when I started eclipse so far, I got an error.

workspace\.metadata\.log


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)

It is because it does not support JDK11, so it needs to be run on JDK8. But I want to run the new eclipse with JDK11, so I don't want to change the environment variable PATH.

Specify javaw.exe to start eclipse

Normally, javaw.exe that is in the PATH is used. You can specify javaw.exe to be used explicitly for each eclipse. Explicitly specify by adding to eclipse.ini in the same location as eclipse.exe.

  1. If eclipse is running, drop it
  2. Open eclipse.ini with a text editor
  3. Add two lines of -vm like the following to the line before -vmargs

eclipse.ini


:
-vm
C:\(JDK8 path)\bin\javaw.exe
-vmargs
:

Start eclipse

It started normally (^ o ^)

If it is an eclipse-based tool such as Spring Tool Suite, it will be solved with the same correspondence except that the ini file name is different.

Recommended Posts

Error when starting eclipse after upgrading JDK
Eclipse error
Javaw.exe error when starting Spring Boot (STS)
Error when starting JUnit with deprecated version of POI
Error when using SnapKit
Error when bundle install
Error when deploying EC2
When starting Eclipse debug, I get a `ERROR: JDWP Transport dt_socket failed` error and cannot start.