在Mac下運行swt出錯:java.lang.UnsatisfiedLinkError: no swt-carbon-3346 or swt-carbon in swt.library.path,

來源:互聯網
上載者:User

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庫路徑中。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.