Question

I'm having an error in intelliJ when trying to run on max osx snow leopard

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    no swt-win32-4234 in java.library.path
    no swt-win32 in java.library.path
    Can't load library: /Users/bigbitecode/.swt/lib/macosx/x86_64/libswt-win32-4234.jnilib
    Can't load library: /Users/bigbitecode/.swt/lib/macosx/x86_64/libswt-win32.jnilib

The code works fine on windows and linux, but for some reason it fails to run after compiling on osx with the complaint above.

Something I find fishy is, "libswt-win32-*" Shouldn't it be using cocoa, since it's compiling on a mac? I checked the directory and sure enough there's nothing in the "../x86_64/" directory. However, I have already added the dependencies for the project to have swt.jar

Could it be that my JVM is set incorrectly?

Thanks for the help!

EDIT: Here's a manifest of my swt.jar which is inside the lib folder

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.3
Created-By: 1.6.0_21-b06 (Sun Microsystems Inc.)
SWT-OS: win32
SWT-WS: win32
SWT-Arch: x86_64
Was it helpful?

Solution

You should match your platforms of OS, VM, SWT.

for example:

OS: Windows 7 32bit VM: JRE 7 win 32bit SWT: win32 binary

or,

OS: Windows 7 64bit VM: JRE 7 win 64bit SWT: win32_x64 binary

so, If your OS is OSX(mac), you should use SWT osx binary, not win32.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top