Hello Guest

yet ANOTHER java.lang.UnsatisfiedLinkError with SWT ...

  • 5 Replies
  • 6096 Views
yet ANOTHER java.lang.UnsatisfiedLinkError with SWT ...
« on: November 10, 2006, 17:02:51 »
I've found some threads on a similar issue but I believe my problem is different.

I'm developing a SWT user interface with a LWJGL GLCanvas in the middle and the program worms perfectly from within Eclipse, but when I try to export it into an executable JAR file I run into the following problem:

When I try to run my executable jar with the LWJGL GLCanvas on the shell, I get the following error:

Code: [Select]
java -jar Test.jar Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-wgl-win32-3235 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.opengl.win32.WGL.<clinit>(WGL.java:17)
        at org.eclipse.swt.opengl.GLCanvas.<init>(GLCanvas.java:80)
        at MainWindow.createOpenGlWindow(MainWindow.java:76)
        at MainWindow.main(MainWindow.java:55)


As evident from the call stack this error happens as the GLCanvas is being initialized.

If I simply replace my GLCanvas with an empty Composite, the entire program works fine as a standalone executable JAR. This means that the SWT system itself as well as the location of the JAR and DLL files are properly configured, at least for standard SWT.

This is my manifest:

Code: [Select]
Manifest-Version: 1.0
Main-Class: MainWindow
Class-Path: swt.jar lwjgl.jar lwjgl_test.jar lwjgl_util.jar lwjgl_util_applet.jar jinput.jar


The following JARs and DLLs are in the root directory of my project:

Code: [Select]
Test.jar (executable)
swt.jar
jinput.jar
lwjgl.jar
lwjgl_test.jar
lwjgl_util.jar
lwjgl_util_applet.jar
swt-win32-3235.dll
lwjgl.dll
jinput-dx8.dll
jinput-raw.dll
OpenAL32.dll


The Java VM is clearly assuming that swt-win32-3235.dll doesn't exist, which it does. If it didn't exist, or if it were a corrupt file, it wouldn't work if I simply replaced GLCanvas with a Composite.

Any ideas? What am I doing wrong?

*

Offline Matzon

  • *****
  • 2242
yet ANOTHER java.lang.UnsatisfiedLinkError with SWT ...
« Reply #1 on: November 10, 2006, 17:15:38 »
hmm, not sure whats going on to be honest - probably more an swt issue than lwjgl ?

yet ANOTHER java.lang.UnsatisfiedLinkError with SWT ...
« Reply #2 on: November 10, 2006, 17:18:54 »
is GLCanvas part of SWT or LWJGL?

*

Offline Matzon

  • *****
  • 2242
yet ANOTHER java.lang.UnsatisfiedLinkError with SWT ...
« Reply #3 on: November 10, 2006, 17:46:47 »
Quote
org.eclipse.swt.opengl.GLCanvas

I'm guessing swt  :wink:

yet ANOTHER java.lang.UnsatisfiedLinkError with SWT ...
« Reply #4 on: November 10, 2006, 18:39:43 »
is there any SWT forum you could recommend? the ones i've found don't seem to be very active.

yet ANOTHER java.lang.UnsatisfiedLinkError with SWT ...
« Reply #5 on: November 17, 2006, 21:38:37 »
Put swt-wgl-win32-3235.dll in your root directory.