0
votes

I try to test a simple java application with SWT under Mac OS X. I can compile the source file without any problems but if I start the program then the following exception occurs:

java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM

The command to compile is: "javac -classpath .:swt.jar SWTHello.java" The command to run is: "java -d64 -XstartOnFirstThread -cp .:swt.jar SWTHello"

For the SWT library there's only one current osx version on the website so I guess I couldn't download a wrong jar.

Thanks in advance for your help!

2
There are 32 and 64 bit versions of the current Mac SWT library - where did you download it from? - greg-449
As @greg-449 already mentioned, there is a 32bit and a 64bit version of the Mac SWT library here on the official website - Baz
I went to eclipse.org/swt and clicked the "OS X" link. On the next page there's a download link but no version selection. So I thought I had the right one. - altralaser
@altralaser Yeah, that's a bit misleading. Did you download the correct one and try again? - Baz
Yes, I found the explicit 64bit version under your posted link and tried it a few minutes ago. It works very well. Now I have my own app that looks like the standard cocoa apps. It's great! Thanks a lot for your help! - altralaser

2 Answers

0
votes

Change the SWT jar in your project classpath, You are using a 32 bits cocoa, use the 64 bits:

http://mvnrepository.com/artifact/org.eclipse.platform/org.eclipse.swt.cocoa.macosx.x86_64

0
votes

Had the same problem and it worked after replacing the swt .

  1. Download swt http://mvnrepository.com/artifact/org.eclipse.platform/org.eclipse.swt.cocoa.macosx.x86_64
  2. Replace it on this folder of your Pentaho-ce /data-integration/libswt/osx64