Rahat Ahmed
Rahat Ahmed

Reputation: 2180

SWT: UnsatisfiedLinkError, cannot load x64 SWT library on 32-bit JVM

At first when developing my program I got this error the other way around; it told me I couldn't use a 32-bit SWT library on a 64-bit JVM. So I went and got the 64-bit library and used that. Now when I run my program on a different computer, which has a 32-bit OS, it gives the error. Is there no way to make SWT run regardless of if you have 32 or 64 bit OS?

Upvotes: 0

Views: 1124

Answers (2)

Lane Aasen
Lane Aasen

Reputation: 729

The build paths are different for each set of SWT libraries so you have to make separate versions for each operating system that you want your application to run on. To do this, configure the build path so that only the JRE and platform-specific libraries are included, then make a runnable jar (Eclipse is excellent for this). It's tedious and goes against the Java paradigm, but its the only way (that I know of).

Upvotes: 0

Ernest Friedman-Hill
Ernest Friedman-Hill

Reputation: 81724

You have to include both versions in your product, so that the correct one is available no matter what the architecture. You can also include Linux and Mac versions, to make your product truly portable.

Upvotes: 1

Related Questions