Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Eclipse Neon error

I am installing Eclipse error and I am getting this error

org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct

Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.1.v20160712-0927
... 

java.lang.NoClassDefFoundError: javax/annotation/PreDestroy

org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:165)at java.base/java.lang.Thread.run(Unknown Source)

Caused by: java.lang.ClassNotFoundException: javax.annotation.PreDestroy cannot be found by org.eclipse.e4.core.di_1.6.1.v20160712-0927

I have set "Path" in System variables as "C:\Program Files\Java\jdk-10.0.1\bin;C:\Program Files\Java\jre-10.0.1\bin" and "CLASSPATH" in System Variables as "C:\Program Files\Java\jdk-10.0.1\bin"

like image 727
Ayman Patel Avatar asked May 18 '18 04:05

Ayman Patel


2 Answers

Make sure that you're version of Eclipse and JDK match, either both 64-bit or both 32-bit, then set the path of the JRE in the environment .

like image 50
RaghuPrasanth V Avatar answered Oct 24 '22 11:10

RaghuPrasanth V


As mentioned @RaghuPrasanth V and @nitind, be sure that your version of Eclipse is working with newer versions of Java.

Because I had the same issue:

org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
...
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418

using Java 11 and Eclipse Java EE IDE for Web Developers. Version: Oxygen Release (4.7.0) Build id: 20170620-1800

And to solve it, I have re-installed to:

Eclipse IDE for Enterprise Java Developers. Version: 2019-03 (4.11.0) Build id: 20190314-1200 from here.

like image 39
invzbl3 Avatar answered Oct 24 '22 09:10

invzbl3