使用exe4j把jar轉換成exe文件時,報錯java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Composite

在使用Eclipse 導出jar後,使用exe4j做成exe文件時保錯,java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Composite,或者

org.eclipse.swt.SWTException: Widget is disposed


解決方法如下:

如果你eclipse export時選擇 Package required libraries into generated jar

在exe4j中就要選 org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader作爲main class (注意這是exe4j裏的設置,eclipse導出時還是選你原來的main class)


如果你export時選擇 Copy required libraries into a sub-folder next to the generated jar
要在exe4j, java invocation中將所有jar添加入class path,這時可以選原來程序裏的main class
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章