1

I developed a SWT runnable jar and supposedly I'm using a 32bit and 64 bit compatible SWT .jar library.

enter image description here

As you can see this SWT jar has 32 and 64 in his name: org.eclipse.swt.win32.win32.x86_64

When I execute this on my developer machine which has java jdk 64 bit installed it works perfectly, but when I execute it on a 32 bit java machine, it gives this error: java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM

Why? is not that library for both 64 and 32 bit as it's name says?

NullPointerException
  • 36,107
  • 79
  • 222
  • 382
  • SWT libraries are different for 32 bit and 64 bit, and different for each platform. That is why there are 32 and 64 bit versions of Eclipse (which is just a very complex SWT program) – greg-449 Nov 13 '18 at 09:05
  • but @greg-449 then this library is for 32 or 64? what should i do? – NullPointerException Nov 13 '18 at 09:08
  • Looks like you have to have separate version for 32 and 64 bit. Eclipse solve this problem by having two version. If they didn't know solution it means that there is no solution at all. – talex Nov 13 '18 at 09:17
  • @talex what should i do now to make my runnable jar compatible with 32 bit java and SO? – NullPointerException Nov 13 '18 at 09:18
  • I can't find where to download a specific 32 bits swt library :S – NullPointerException Nov 13 '18 at 09:22
  • Look at the bottom of that page: [eclipse.org](http://download.eclipse.org/eclipse/downloads/drops4/R-4.9-201809060745/) – LuCio Nov 13 '18 at 09:32
  • ok thank you @LuCio – NullPointerException Nov 13 '18 at 09:48
  • As far as I know, this applies not only to SWT: 32 bit and 64 bit Java require different native libraries. Would shipping with a 32 bit JRE be an option for you? This would work for Windows 32 bit and 64 bit. – howlger Nov 13 '18 at 09:52
  • `x86_64` library is for 64 bit only and requires a 64 bit JRE. There is also an `x86` library which is 32 bit and requires a 32 bit JRE. It is usual to build separate jars for each architecture and platform. The [Eclipse Project Downloads](http://download.eclipse.org/eclipse/downloads/) has all the SWT builds. – greg-449 Nov 13 '18 at 09:59
  • @NullPointerException There are quite a few questions about 32 and 64 bit versions of SWT apps out there. [Here's one that also links to others](https://stackoverflow.com/questions/23359351/build-one-jar-per-platform-for-multi-platform-swt-application). Mayhe that helps. – Baz Nov 13 '18 at 11:13

0 Answers0