SWT on Windows 64-bit
Asked Answered
T

6

40

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?

Tamasha answered 27/5, 2010 at 12:48 Comment(0)
R
43

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!

Robrobaina answered 31/10, 2010 at 14:20 Comment(3)
This is correct, but just a quick note that if you don't have control over which SWT gets used (e.g. developing a plug-in on a 64-bit system with your 64-bit JVM for a 32-bit RCP application), you should just install & use a 32-bit JVM to launch your product instead of modifying your RCP target platform (see Mario Marinato's answer).Darnel
New version of : 64-bit SWTSilverstein
The 64 bit SWT is pretty well hidden. I had to look very carefully before I find it. Basically, under 'Releases' on eclipse.org/swt , click 'More', and look for 'Windows (x86_64)'Seism
R
7

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.

Roundfaced answered 6/6, 2011 at 12:23 Comment(1)
If you are developing a 32-bit RCP application within a 64-bit version of Eclipse, you also have to configure the target platform of the application to explicitly use the x86 architecture. Otherwise Eclipse PDE will still set the 64-bit versions of the SWT libraries as plugin dependencies.Jammie
B
2

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

Bhagavadgita answered 2/1, 2012 at 22:57 Comment(0)
C
2

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.

Conformist answered 22/7, 2014 at 5:56 Comment(0)
P
1

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.

Personalize answered 29/5, 2010 at 5:43 Comment(2)
What is the "delta pack"? I'm curious about a generic solution, because I would love to make my SWT application dynamically select the correct jar. Also, you should bear in mind that SWT needs to be the same version as your virtual machine -- not necessarily as your O/S.Formfitting
The delta pack will not let you do anything 'dynamic', it just gives you the ability to build for any target from any target. louismrose.wordpress.com/2009/01/23/…Personalize
A
1

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.

Awash answered 17/11, 2014 at 21:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.