SWT on Windows 64-bit

2020-01-31 02:25发布

My application throws the exception below.

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

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

6条回答
Summer. ? 凉城
2楼-- · 2020-01-31 03:05

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

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.

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

查看更多
萌系小妹纸
3楼-- · 2020-01-31 03:06

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

查看更多
看我几分像从前
4楼-- · 2020-01-31 03:06

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:

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

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

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

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

Stable

Windows, Linux, OS X, more...

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

And that is exactly the version you need.

查看更多
SAY GOODBYE
5楼-- · 2020-01-31 03:09

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.

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)".

I hope it helps you somehow.

查看更多
啃猪蹄的小仙女
6楼-- · 2020-01-31 03:15

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.

查看更多
贼婆χ
7楼-- · 2020-01-31 03:18

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.

查看更多
登录 后发表回答