原文出处:http://www.cs.umanitoba.ca/~eclipse/1-Install.pdf
1 .swt.jar所在的位置
win32: INSTALLDIR/eclipse/plugins/org.eclipse.swt.win32_3.0.0/ws/win32/
gtk: INSTALLDIR/eclipse/plugins/org.eclipse.swt.gtk_3.0.0/ws/gtk/
motif: INSTALLDIR/eclipse/plugins/org.eclipse.swt.motif_3.0.0/ws/motif/
photon: INSTALLDIR/eclipse/plugins/org.eclipse.swt.photon_3.0.0/ws/photon/
macosx: INSTALLDIR/eclipse/plugins/org.eclipse.swt.carbon_3.0.0/ws/carbon/
2.加入swt.jar所需要的SWT run-time DLL
(否则会报“java.lang.UnsatisfiedLinkError: no swt-win32-2133 in java.library.path”错误)
DLL文件位置:
Windows: INSTALLDIR/eclipse/plugins/org.eclipse.swt.win32_3.0.0/os/win32/x86
Linux GTK: INSTALLDIR/eclipse/plugins/org.eclipse.swt.gtk_3.0.0/os/linux/x86
Linux Motif: INSTALLDIR/eclipse/plugins/org.eclipse.swt.motif_3.0.0/os/linux/x86
加入的方法:
1.将DLL文件的路径作为swt程序运行时的java虚拟机变量
-Djava.library.path=<folder containing the SWT DLL>
2.在操作系统的环境变量中加入DLL文件的路径。
Linux/UNIX 下修改 “LD_LIBRARY_PATH"
Windows下修改“PATH”
3.Windows下将DLL文件拷贝到Windows/System32文件夹中
4.将DLL文件拷贝到项目文件夹的根目录下
本文档详细介绍了如何在项目中集成SWT库,包括swt.jar的位置,以及在Windows和Linux环境下解决缺失SWT运行时DLL的问题。提供了解决 UnsatisfiedLinkError 的四种方法:设置java.library.path、修改环境变量、复制DLL到System32或项目目录。
3098

被折叠的 条评论
为什么被折叠?



