Linux Lubuntu Eclipse Checkstyle SWT 错误

标签 linux eclipse swt

我安装了 Lubuntu 12.10 64 位和 Eclipse Juno Distribution。如果我切换到 Preferences-Checkstsyle 并进行配置(打开 checkstyle 配置),则会出现以下异常:

org.eclipse.swt.SWTError: No more handles [MOZILLA_FIVE_HOME='/home/user/Development/Tools/firefox18.0.2'] (java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    /home/user/Development/IDE/eclipse/configuration/org.eclipse.osgi/bundles/626/1/.cp/libswt-mozilla-gtk-4234.so: libxpcom.so: wrong ELF class: ELFCLASS32
    no swt-mozilla-gtk in java.library.path
    /home/user/.swt/lib/linux/x86_64/libswt-mozilla-gtk-4234.so: libxpcom.so: wrong ELF class: ELFCLASS32
    Can't load library: /home/user/.swt/lib/linux/x86_64/libswt-mozilla-gtk.so
)
    at org.eclipse.swt.SWT.error(SWT.java:4387)
    at org.eclipse.swt.browser.Mozilla.initMozilla(Mozilla.java:1970)
    at org.eclipse.swt.browser.Mozilla.create(Mozilla.java:699)
    at org.eclipse.swt.browser.Browser.<init>(Browser.java:99)
    at net.sf.eclipsecs.ui.config.CheckConfigurationConfigureDialog.createDialogArea(CheckConfigurationConfigureDialog.java:207)
    at org.eclipse.jface.dialogs.TitleAreaDialog.createContents(TitleAreaDialog.java:155)
    at org.eclipse.jface.window.Window.create(Window.java:431)
    at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
    at net.sf.eclipsecs.ui.config.CheckConfigurationConfigureDialog.create(CheckConfigurationConfigureDialog.java:222)
    at org.eclipse.jface.window.Window.open(Window.java:790)
    at net.sf.eclipsecs.ui.config.CheckConfigurationWorkingSetEditor.configureCheckConfig(CheckConfigurationWorkingSetEditor.java:505)
    at net.sf.eclipsecs.ui.config.CheckConfigurationWorkingSetEditor.access$6(CheckConfigurationWorkingSetEditor.java:492)
    at net.sf.eclipsecs.ui.config.CheckConfigurationWorkingSetEditor$PageController.widgetSelected(CheckConfigurationWorkingSetEditor.java:391)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1276)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3554)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3179)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
    at org.eclipse.jface.window.Window.open(Window.java:801)
    at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.open(WorkbenchPreferenceDialog.java:215)
    at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:65)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1276)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3554)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3179)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1029)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:923)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    /home/user/Development/IDE/eclipse/configuration/org.eclipse.osgi/bundles/626/1/.cp/libswt-mozilla-gtk-4234.so: libxpcom.so: wrong ELF class: ELFCLASS32
    no swt-mozilla-gtk in java.library.path
    /home/user/.swt/lib/linux/x86_64/libswt-mozilla-gtk-4234.so: libxpcom.so: wrong ELF class: ELFCLASS32
    Can't load library: /home/user/.swt/lib/linux/x86_64/libswt-mozilla-gtk.so

    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:331)
    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:240)
    at org.eclipse.swt.browser.Mozilla.initMozilla(Mozilla.java:1955)
    ... 50 more

我在网上找到了很多关于这个问题的帖子,但没有一个可以帮助我。我究竟需要做什么?目前我只在 home/user 的 .profile 中设置了 MOZILLA_FIVE_HOME 路径。

我当前已经安装了 Oracle JDK 1.7,我在 PATH 和 JAVA_HOME 中引用了它。

很高兴能得到你们的帮助。

问候 马克

最佳答案

我在 Fedora 19(64 位)上遇到了类似的问题。我通过以下步骤解决了这个问题:

1. $ sudo yum install libwebkitgtk*
2. Restart Eclipse

关于Linux Lubuntu Eclipse Checkstyle SWT 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14919762/

相关文章:

java - SWT 表查看器在行选择上添加复选框

c - 在 c 中使用 ntfw 时跳过子目录

linux - 我怎样才能告诉 Linux 保留一个页面而不是逐出它?

java - Eclipse 将包组织到文件夹层次结构中

java - 在没有反应堆的情况下按顺序清理/安装多个maven项目

java - 在 Mac 上运行 SWT 应用程序抛出非法线程访问

java - 为 Windows/Linux 桌面打包 Java 应用程序

linux - 如何在 Linux 上查找哪些进程已写入文件

linux - 脚本中和脚本外的相同命令的结果不同

java - 如何反射(reflect)另一个项目的类信息