SWT小程序:swt-win32-3650.dll已经加载到另一个类加载器中

时间:2010-06-08 13:19:29

标签: java applet swt

我有多个使用SWT编写的java applet页面。问题是,applet仅在第一页上加载,在另一页上加载我需要重新启动浏览器,否则我会收到以下错误:

Exception in thread "Thread-27" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    no swt-win32-3650 in java.library.path
    no swt-win32 in java.library.path
    Native Library C:\Documents and Settings\xxx\Local Settings\Temp\swtlib-32\swt-win32-3650.dll already loaded in another classloader
    C:\Documents and Settings\xxx\Local Settings\Temp\swtlib-32\swt-win32.dll: %1 is not a valid Win32 application

at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)

我想知道,当applet的浏览器页面关闭时,如何卸载swt dll?

1 个答案:

答案 0 :(得分:2)

Applet类:

    @Override
    public void stop() {
        // do this to unload swt dlls
        System.exit(0);
    }