在Mac下运行swt出错:java.lang.UnsatisfiedLinkError: no swt-carbon-3346 or swt-carbon in swt.library.path, java.library.path or the jar file
2009-02-03 09:59
1301 查看
Ok, the resources that you need to read are:
First, you need to read an awesome background article at Borderland Consulting
Then, you'll want the very cool Jar Bundler Ant Task which will put together an app bundle for you and copy all your jars into the right directory structure and create an Info.plist file for you
Then (and this bit just killed me), you must make sure that you chmod your .jnilib files executable! If you don't, you'll end up getting a "Could not load library" error even though the swt library is clearly in your java.library.path!
Finally, you must add an entry StartOnMainThread
to your Info.plist file which resolved some Threading issues with the launcher. If you're getting weird GUI behaviour with disappearing buttons and bizarre crashes, it will probably be cause you've missed this setting.
no swt-carbon-3346 or swt-carbon in swt.library.path, java.library.path or the jar file 大意即,如果SWT应用程序用到了SWT组件,则还必须将SWT的本地化文件加入到JVM可以找到的路径中。方法有三个:
1.修改每个工程运行时的运行VM参数,用-Djava.library.path={runtime-library-path}把本地化SWT库文件通知JVM。显然,这是指在Eclipse平台下运行,而且每个工程都要修改一次,很麻烦。
2.在环境变量中设置库路径。对于Linux,就是修改LD_LIBRARY_PATH这个环境变量,让它指到本地化SWT库中。
3.拷贝本地化SWT库文件到已经指定的Java库路径中。
First, you need to read an awesome background article at Borderland Consulting
Then, you'll want the very cool Jar Bundler Ant Task which will put together an app bundle for you and copy all your jars into the right directory structure and create an Info.plist file for you
Then (and this bit just killed me), you must make sure that you chmod your .jnilib files executable! If you don't, you'll end up getting a "Could not load library" error even though the swt library is clearly in your java.library.path!
Finally, you must add an entry StartOnMainThread
no swt-carbon-3346 or swt-carbon in swt.library.path, java.library.path or the jar file 大意即,如果SWT应用程序用到了SWT组件,则还必须将SWT的本地化文件加入到JVM可以找到的路径中。方法有三个:
1.修改每个工程运行时的运行VM参数,用-Djava.library.path={runtime-library-path}把本地化SWT库文件通知JVM。显然,这是指在Eclipse平台下运行,而且每个工程都要修改一次,很麻烦。
2.在环境变量中设置库路径。对于Linux,就是修改LD_LIBRARY_PATH这个环境变量,让它指到本地化SWT库中。
3.拷贝本地化SWT库文件到已经指定的Java库路径中。
相关文章推荐
- Android SDK no swt-pi-gtk-3550 or swt-pi-gtk in swt.library.path, java.library.path or the jar解决
- windows下no swt-gtk-3550 or swt-gtk in swt.library.path, java.library.path or the jar的解决办法
- Android SDK no swt-pi-gtk-3550 or swt-pi-gtk in swt.library.path, java.library.path or the jar解决
- firefox升级后SWT程序错误(java.lang.UnsatisfiedLinkError: no swt-mozilla-gtk-3349 or swt-mozilla-gtk in swt.library.path, java.library.p
- 解决ubuntu或linux mint运行SDKManage[no swt-gtk-3550 or swt-gtk in swt.library.path, java.library.pat]错误!
- jni调用 java.lang.UnsatisfiedLinkError: no segmentor_jni in java.library.path
- No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/D:/package/java/hibernat
- CentOS 运行 Java的图形出错: libXtst.so.6: cannot open shared object file: No such file or directory
- java.lang.UnsatisfiedLinkError,(A file or directory in the path name does not exist.
- java.lang.UnsatisfiedLinkError: no XXX in java.library.path
- CentOS 安装 oralce Java的图形出错: libXtst.so.6: cannot open shared object file: No such file or directory
- 解决no swt-win32-3236 in java.library.path的方法大致有这么两种:
- Exception in thread "main" java.lang.UnsatisfiedLinkError: no hello in java.library.path
- apk运行出错 Error: java.lang.RuntimeException: Binary XML file line #
- java.lang.UnsatisfiedLinkError:no in java.library.path解决办法
- java.lang.UnsatisfiedLinkError: no jacob in java.library.path
- 警告:failed to load the sqljdbc_auth.dll cause no sqljdbc_auth in java.library.path
- 运行jar包出现问题:java.lang.SecurityException: JCE cannot authenticate the provider BC
- java.lang.UnsatisfiedLinkError: no XXX in java.library.path
- java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path