站内搜索: 请输入搜索关键词

当前页面: 开发资料首页Eclipse 专题SWT中运行程序出现no swt-win32-3139 in java.library.path该如何解决?

SWT中运行程序出现no swt-win32-3139 in java.library.path该如何解决?

摘要: SWT中运行程序出现no swt-win32-3139 in java.library.path该如何解决?


我在SWT4.3.0中创建了一个窗口,但是,运行方式为JAVA应用程序时就出现no swt-win32-3139 in java.library.path的错误:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-win32-3139 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:123)
at org.eclipse.swt.internal.win32.OS.(OS.java:18)
at org.eclipse.swt.widgets.Display.(Display.java:125)
at hello.HelloWorld.main(HelloWorld.java:15)
我用网上提供的导入swt-win32-3139.dll的方法,SWT4.3.0中没有这个DLL。
请问还有其它方法不?


来个简单的,将swt-win32-3139.dll拷贝到 windows/system32 下去试试


在你的安装目录下,搜索一下该文件,找到哪个包下的哪个文件,在你的工程上加入该文件即可运行!


如果swt-win32-3139.dll在d:/lib下,增加参数:

-Djava.library.path=d:/lib


To finish configuring your system for using SWT you need to install the SWT run-time DLL. If you try to start standalone SWT application without this you will get an error similar to: “java.lang.UnsatisfiedLinkError: no swt-win32-XXXX in java.library.path”. The SWT run-time DLL that swt.jar requires is not available to the program. The easiest method to solve this problem is to copy this DLL to a folder in your PATH. A recommended standard choice (for Windows NT/2000/XP) is your Windows/System32 folder. The disadvantage of this method is that if you upgrade Eclipse and get a different version of SWT, you must remember to copy the new version of the SWT DLL to this location again.

As with swt.jar, the location of the DLL is platform dependent.

Windows: $ECLIPSE$/plugins/org.eclipse.swt.win32_3.0.0/os/win32/x86/
Linux GTK: $ECLIPSE$/plugins/org.eclipse.swt.gtk_3.0.0/os/linux/x86/
Linux Motif: $ECLIPSE$/plugins/org.eclipse.swt.motif_3.0.0/os/linux/x86/



将swt-win32-3139 的包导入项目


不用那么麻烦了,ECLIPSE3.1以后,支持直接以JAVA SWT方式RUN你的程序,不需要任何辅助参数配置。建议升级你的ELCIPSE,并且建一个完成RCP应用的过程也由向导简化了。



↑返回目录
前一篇: 关于eclipse运行时的错误
后一篇: 各位前辈.小弟刚接触eclipse,请问在eclipse中如何开发JSP