java.lang.UnsatisfiedLinkError:无法在 Windows x86 计算机中的 32 位 JVM 上加载 64 位 SWT 库
我刚刚开始使用 swt (windows x86_x64 兼容版本)。 当我在 Eclipse 中运行示例代码片段时,出现以下错误...
Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
at Snippets.main
我的计算机上装有 Windows Vista。我相信这个 swt 版本应该支持 32 位和 64 位操作系统。为了使 32 位工作正常,我缺少什么?
如果我的 JVM 版本错误,该如何更改?
I've just started using swt (windows x86_x64 compatible version).
When I run a sample code snippet in Eclipse, I am getting the following error...
Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
at Snippets.main
I have Windows Vista on my machine. I believe this swt version should support both 32 bit and 64 bit Os. What am I missing to get things work for 32 bit?
If in case I've a wrong version of JVM, how do I change it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
请在以下位置找到 32 位库...
http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.7-201106131736/swt-3.7 -win32-win32-x86.zip
使用 zip 中的 swt.jar。
Please find the 32 bit library at following location...
http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.7-201106131736/swt-3.7-win32-win32-x86.zip
Use the swt.jar from zip.
这里给出了Eclipse上32位安装SWT的解决方案
http://www.badprog.com/eclipse-standard-widget-toolkit -swt-安装
A solution is given for the 32 bit installation of SWT on Eclipse here
http://www.badprog.com/eclipse-standard-widget-toolkit-swt-installation
x86_64版本肯定无法在32位进程中工作。您需要获取 32 位版本的 SWT。
The x86_64 version will definitely not work in a 32-bit process. You need to get a 32-bit version of SWT.
如果您尝试针对 32 位 JRE 运行 64 位库,就会发生这种情况。 32 位可以在 64 位上运行,但反之则不行。
如果您安装了64位JVM,您可以在菜单“运行”>“修改”中修改设置。运行配置然后选择正确的 JRE。
否则只需获取 32 位版本的 SWT。
This happens if you try to run a 64bit library against a 32bit JRE. 32bit can run on 64bit but not vice versa.
If you have a 64bit JVM installed, you can modify settings in the menu Run > Run Configuration then select the correct JRE.
Otherwise just get the 32bit version of the SWT.
一种特殊情况是,如果您仅在尝试打开Android sdk管理器时看到它,则表明sdk工具无法正确找到您的java.exe。转到您的 sdk 文件夹,打开 tools/android.bat 文件,找到“set java_exe”这一行,将其更改为“set java_exe=ABSOLUTE_PATH_TO_YOUR_JAVA_EXE”并注释掉以下两行;
One special case is that if you only see it when you try to open Android sdk manager, which indicates that the sdk tools cannot locate your java.exe properly. Go to your sdk folder, open tools/android.bat file, find the line says "set java_exe", change it to "set java_exe=ABSOLUTE_PATH_TO_YOUR_JAVA_EXE" and comment out the two following lines;
我的日食没有开始。我检查了workspace/.metadata/.log 中的日志。 java.lang.UnsatisfiedLinkError:无法在 32 位 JVM 上加载 64 位 SWT 库
存在异常。这是因为我的机器,eclipse,java配置是这样造成的
机器:Windows:64位
日食:64 位
Java:32 位
我更正了 JAVA_HOME & 路径。似乎不起作用。
解决方案:我在 eclipse.ini 文件中添加了 -vm 和正确的 jvm 路径。这对我有用。我能够启动日食。
示例:我指向 64 位 jvm 来启动 64 位 eclipse
My eclipse was not starting. I checked the logs in workspace/.metadata/.log. java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM
exception was present. This was caused because my machine, eclipse, java configuration was like this
Machine: Windows : 64 bit
Eclipse : 64 bit
Java : 32 bit
I corrected JAVA_HOME & Path. Did not seem to work.
Solution : I added -vm with correct jvm path in
eclipse.ini
file. It worked for me. I was able to start eclipse.Example : I pointed to 64bit jvm to start 64bit eclipse