安装Eclipse Neon错误

时间:2018-05-18 04:55:36

标签: eclipse installation eclipse-neon

我正在安装Eclipse错误,我收到此错误

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

我在系统变量中将“Path”设置为“C:\ Program Files \ Java \ jdk-10.0.1 \ bin; C:\ Program Files \ Java \ jre-10.0.1 \ bin” 和系统变量中的“CLASSPATH”为“C:\ Program Files \ Java \ jdk-10.0.1 \ bin”

3 个答案:

答案 0 :(得分:6)

<强>您好,

在eclipse.ini

的末尾添加此行
--add-modules=java.se.ee

答案 1 :(得分:1)

确保您和Eclipse和JDK的版本都匹配     64位或两者都是32位,然后设置JRE的路径     环境。

答案 2 :(得分:0)

@RaghuPrasanth V@nitind所述,请确保您的Eclipse版本正在使用Java的较新版本。

因为我有同样的问题:

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

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

要解决此问题,我已重新安装到:

来自here

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