简体   繁体   English

无法在osx上加载SWT库

[英]unable to load SWT library on osx

I'm having an error in intelliJ when trying to run on max osx snow leopard 尝试在Max OSX Snow Leopard上运行时intelliJ出现错误

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. 该代码在Windows和Linux上都可以正常运行,但是由于某种原因,在上面提到的问题上在osx上编译后,该代码无法运行。

Something I find fishy is, "libswt-win32-*" Shouldn't it be using cocoa, since it's compiling on a mac? 我发现有些可疑的地方是“ libswt-win32- *”,因为它是在Mac上编译的,所以不应该使用可可粉吗? I checked the directory and sure enough there's nothing in the "../x86_64/" directory. 我检查了目录,并确定“ ../x86_64/”目录中没有任何内容。 However, I have already added the dependencies for the project to have swt.jar 但是,我已经为该项目添加了依赖项,使其具有swt.jar

Could it be that my JVM is set incorrectly? 可能是我的JVM设置不正确吗?

Thanks for the help! 谢谢您的帮助!

EDIT: Here's a manifest of my swt.jar which is inside the lib folder 编辑:这是我的swt.jar的清单,它位于lib文件夹中

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

You should match your platforms of OS, VM, SWT. 您应该匹配您的OS,VM,SWT平台。

for example: 例如:

OS: Windows 7 32bit VM: JRE 7 win 32bit SWT: win32 binary 操作系统: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 操作系统: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. 因此,如果您的操作系统是OSX(mac),则应使用SWT osx二进制文件,而不是win32。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM