Cannot load 64-bit SWT libraries on 32-bit JVM

来源:互联网 发布:每天销售数据统计表 编辑:程序博客网 时间:2024/05/16 05:04

在64位的机器上,使用64位的(path)的jre开发eclipse插件,运行时出错。

java.lang.UnsatisfiedLinkError:Cannot load 64-bit SWT libraries on 32-bit JVM    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194)    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:174)    at org.eclipse.swt.internal.C.<clinit>(C.java:21)    at org.eclipse.swt.widgets.Display.<clinit>(Display.java:138)    at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:687)    at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)    at de.vogella.rcp.intro.first.Application.start(Application.java:18)    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:369)    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)    at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    at java.lang.reflect.Method.invoke(Method.java:597)    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)    at org.eclipse.equinox.launcher.Main.run(Main.java:1408)    at org.eclipse.equinox.launcher.Main.main(Main.java:1384)An error has occurred.See the log file


解决方法:

更改jre,因为系统中也默认安装了32bit的jre,将至切换为64位的jre即可。

Installed JREs

You can click Add and navigate to your 32-bit JVM's JAVA_HOME to add it.

Then in your Run Configuration, find your Eclipse Application and make sure the Runtime JRE is set to the 32-bit JRE you just configured:

Run Configuration