Eclipse Kepler启动错误“NoClassDefFoundError:org / eclipse / swt / widgets / Display”

时间:2013-07-08 12:50:01

标签: java eclipse eclipse-kepler

我在Ubuntu 64位上使用Eclipse Kepler 64位和Sun JDK 1.7.0_25 64位。当我使用JDK 1.6时Eclipse工作但升级到JDK 1.7后停止工作(使用webupd8.org的方法和流行的askubuntu解决方案),现在在启动时它告诉我有一个错误,并且检查configuration/xxx.log个文件。

这是它在启动时创建的每个日志文件内容的开头:

!SESSION 2013-07-08 15:38:11.495 -----------------------------------------------
eclipse.buildId=4.3.0.I20130605-2000
java.version=1.7.0_25
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86_64

!ENTRY org.eclipse.equinox.ds 4 0 2013-07-08 15:38:12.212
!MESSAGE [SCR] Exception while activating instance org.eclipse.e4.ui.css.swt.internal.theme.ThemeEngineManager@b1320f9 of component org.eclipse.e4.ui.css.swt.theme  
!STACK 0
java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Display
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2521)
        at java.lang.Class.getDeclaredMethods(Class.java:1845)
        at org.eclipse.equinox.internal.ds.model.ServiceComponent.getMethod(ServiceComponent.java:126)
        at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:213)
        at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
        at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345)
        at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
        at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)

我已清理工作区,运行./eclipse -clean但它没有通过徽标。还有什么需要检查/清理吗?

4 个答案:

答案 0 :(得分:4)

您需要在运行配置中为您的计算机添加适当的SWT插件。

1. Click Run -> Run Configurations...
2. Select the Run Configuration that is failing (on the left side)
3. Click the Plug-ins tab
4. In the "type filter text" box, type swt
5. Select the proper swt package for your machine.  For me on OS X this was:
org.eclipse.swt.cocoa.macosx.x86_64

然后正常运行它应该可以工作。

答案 1 :(得分:1)

我无法弄清楚出了什么问题,但是降级到Eclipse Juno有效。

答案 2 :(得分:0)

转到日食快捷方式的属性并添加-clean参数。

  

“C:\ Program Files(x86)\ Eclipse \ eclipse.exe”-clean

使用该快捷方式打开eclipse,然后再次删除-clean参数。

在Ubuntu中,你必须从你的终端运行eclipse并在最后添加-clean

答案 3 :(得分:0)

我这样做的方式,创造了一个新的工作区,而不是仅使用我的旧工作区。你试过吗?