Windows 64 位上的 SWT

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2921193/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 07:21:26  来源:igfitidea点击:

SWT on Windows 64-bit

windows64-bitswt

提问by Palanisami

My application throws the exception below.

我的应用程序抛出以下异常。

Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SW T libraries on 64-bit JVM.

线程“main”中的异常 java.lang.UnsatisfiedLinkError:无法在 64 位 JVM 上加载 32 位 SW T 库。

How to solve this? What is the name of jar file needed?

如何解决这个问题?需要的jar文件名是什么?

回答by Daniel

On 64-bit JVM's you need the 64-bit SWT. Current versions can be downloaded here:

在 64 位 JVM 上,您需要 64 位 SWT。当前版本可以在这里下载:

http://archive.eclipse.org/eclipse/downloads/drops/R-3.6.1-201009090800/index.php#SWT

http://archive.eclipse.org/eclipse/downloads/drops/R-3.6.1-201009090800/index.php#SWT

Note the first two downloads, the first is for x32, the other for x64.

请注意前两个下载,第一个用于 x32,另一个用于 x64。

Note:Even on 64bit Windows, if you use the 32bit JVM, you still need the 32bit SWT version!

注意:即使在 64 位 Windows 上,如果您使用 32 位 JVM,您仍然需要 32 位 SWT 版本!

回答by Mario Marinato

I faced the same problems a couple of weeks ago. We develop an RCP application that must use 32bit SWT, but we work on 64bit machines.

几周前我遇到了同样的问题。我们开发了一个必须使用 32 位 SWT 的 RCP 应用程序,但我们在 64 位机器上工作。

What we had to do was to change Eclipse's configurations so it pointed to a 32bit JVM. We did it on Window -> Preferences -> Java -> Installed JRE's. On this preference page, we changed all references from "Program Files" to "Program Files (x86)".

我们必须做的是更改 Eclipse 的配置,使其指向 32 位 JVM。我们在 Window -> Preferences -> Java -> Installed JRE's 上做了。在此首选项页面上,我们将所有引用从“ Program Files”更改为“ Program Files (x86)”。

I hope it helps you somehow.

我希望它能以某种方式帮助你。

回答by Ravenwater

For the latest link to SWT library downloads: SWT project page

有关 SWT 库下载的最新链接: SWT 项目页面

回答by Nenad Bulatovic

My answer is more less compilation of above posted answers, especially the comment of the user @ClickUpvote who provided (by my opinion) the best answer. So here it is, I tested it just before posting it:

我的答案是对以上发布的答案的汇编更少,尤其是提供(我认为)最佳答案的用户@ClickUpvote 的评论。所以在这里,我在发布之前对其进行了测试:

If your application throws the exception below (On Windows 7 64 bit, with JVM 64)

如果您的应用程序抛出以下异常(在 Windows 7 64 位上,使用 JVM 64)

Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SW T libraries on 64-bit JVM.

线程“main”中的异常 java.lang.UnsatisfiedLinkError:无法在 64 位 JVM 上加载 32 位 SW T 库。

Then the solution is as follows: On 64-bit JVM's you need the 64-bit SWT.

那么解决方案如下: 在 64 位 JVM 上,您需要 64 位 SWT。

Current versions can be downloaded as described below - pretty well hidden:

当前版本可以按如下所述下载 - 隐藏得很好:

Stable

Windows, Linux, OS X, more...

稳定的

Windows、Linux、OS X等等……

Windows (x86_64) (Supported Versions) (http) 6.3 MB swt-4.4-win32-win32-x86_64.zip

Windows (x86_64)(支持的版本)(http) 6.3 MB swt-4.4-win32-win32-x86_64.zip

And that is exactly the version you need.

这正是您需要的版本。

回答by Kristy Welsh

Those links are all a little out of date for downloads of the 64-bit versions. Try this one: http://jarfiles.pandaidea.com/swt.html, found after an hour of googling.

对于 64 位版本的下载,这些链接都有些过时。试试这个:http: //jarfiles.pandaidea.com/swt.html,经过一个小时的谷歌搜索后找到。

回答by andyczerwonka

You're simply building against the wrong version of SWT. Either download the 64bit Eclipse or grab the delta pack and build against the correct target environment.

您只是针对错误版本的 SWT 进行构建。下载 64 位 Eclipse 或获取增量包并针对正确的目标环境进行构建。