Mad*_*d-D 23 java swt jvm eclipse-plugin eclipse-rcp
我正在尝试调试此问题,但不确定我需要在哪里替换 Eclipse的SWT jar文件.
当前系统配置:
Eclipse Helios 3.6 - 32 Bit
JDK 1.6
JVM - 32 Bit
Windows 7 - 64 Bit
Run Code Online (Sandbox Code Playgroud)
错误信息:
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(Native Method)
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
Run Code Online (Sandbox Code Playgroud)
解决方法:
Link1:理解问题的原因,我试图将64位SWT替换为32位,但我不确定我是否正确行事?
下载32位文件swt-3.6.1-win32-win32-x86.zip提取zip文件包含如下所示的文件
复制swt.jar文件导航到C:\ Program Files\eclipse\plugins删除64位Swt文件(即org.eclipse.swt.win32.win32.x86_64.source_3.6.2.v3659c)放置复制的swt.jar文件并重新启动
仍然会抛出相同的错误
还尝试将swt.jar文件重命名为org.eclipse.swt.win32.win32.x86_64.source_3.6.2.v3659c
仍然是相同的错误
Link2:建议替代解决方案,但无法解决问题.
仍然是相同的错误
我真的不想卸载32-JVM和32位Eclipse并安装相应的64位版本.
不是选择
解决方法在paulsm4和Paul Webster回应之后我很困惑
当我尝试执行此操作以检查Eclipse中的JVM,JRE版本时
package javaVersion;
public class JavaVersion
{
public static void main( String[] args )
{
System.out.println( "JRE Version :" + System.getProperty( "java.runtime.version" ) );
System.out.println( "JVM Bit size: " + System.getProperty( "sun.arch.data.model" ) );
}
}
Run Code Online (Sandbox Code Playgroud)
输出:
1.6.0_31-b05
JVM Bit size: 32
Run Code Online (Sandbox Code Playgroud)
但是,当我在命令行上试用JAVA时 - VERSION
所以我的理解系统有64位JVM,而Eclispe正在读取32位JVM.那么我怎样才能将系统转移到读取32位JVM?
Edw*_*son 27
Eclipse正在使用您在启动配置中定义的任何JRE启动应用程序.由于您运行的是32位Eclipse,因此您正在针对其32位SWT库运行/调试,并且您需要运行32位JRE.
无论出于何种原因,您的64位JRE是您的默认安装JRE.
要更改此设置,请首先确保在Installed JREs首选项中配置了32位JRE.转到Window - > Preferences并导航到Java - > Installed JREs:
您可以单击"添加"并导航到32位JVM JAVA_HOME
以添加它.
然后在Run Configuration中找到Eclipse Application并确保将Runtime JRE设置为刚刚配置的32位JRE:
(注意突出显示不佳的组合框.)
不要尝试更换SWT罐,这可能会很糟糕.
好吧,duh :) SWT使用JNI ...而JNI是严格针对特定平台的.
使用带有32位JVM的32位库,带有64位JVM的64位库,确保版本完全匹配,并且不要混合"匹配".
恕我直言...
PS:您可以在同一个盒子上共存多个JVM和/或多个Eclipse.
归档时间: |
|
查看次数: |
103896 次 |
最近记录: |