Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SWT on Windows 64-bit

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?

like image 572
Palani Avatar asked May 27 '10 12:05

Palani


People also ask

What is SWT in it?

SWT is an open source widget toolkit for Java designed to provide efficient, portable access to the user-interface facilities of the operating systems on which it is implemented.

How do I download a SWT jar file?

You can get it under "releases" on the SWT eclipse page. Show activity on this post. Show activity on this post. You can go to the Java2s and below the code you can find download button, not only this jar you can find many(official) jar files from there.

What is a SWT application?

The Standard Widget Toolkit (SWT) is a Java based user interface library for developing desktop application. SWT supports Windows, Linux and Mac OS X. It provides lots of standard widgets, e.g., buttons and text fields as well as the option to create custom widgets.

What is the difference between SWT and Swing?

The primary design goals are high performance, native look and feel, and deep platform integration. Swing, on the other hand, is designed to allow for a highly customizable look and feel that is common across all platforms.


2 Answers

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!

like image 125
Daniel Avatar answered Oct 05 '22 05:10

Daniel


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.

like image 30
Mario Marinato Avatar answered Oct 05 '22 06:10

Mario Marinato