I have a java webstart application which uses swt for the interface (and includes DJ Native Swing). The application runs fine on windows, until I try to add the linux and mac osx swt jars to the application in order to support those platforms. The application runs fine under linux when started from netbeans with only the correct jars linked, but when launching the application through java webstart on any platform, it seems the wrong jar files are loaded.
This is what i have in my launch.jnlp (among other stuff):
<resources os="Windows" arch="x86">
<j2se java-vm-args="-Xmx512m" version="1.5+"/>
<jar href="lib/swt-win32-x86.jar"/>
<nativelib href="lib/swt-win32-x86.jar"/>
</resources>
<resources os="Windows" arch="x86_64">
<j2se java-vm-args="-Xmx512m" version="1.5+"/>
<jar href="lib/swt-win32-x86_64.jar"/>
<nativelib href="lib/swt-win32-x86_64.jar"/>
</resources>
<resources os="Windows" arch="amd64">
<j2se java-vm-args="-Xmx512m" version="1.5+"/>
<jar href="lib/swt-win32-x86_64.jar"/>
<nativelib href="lib/swt-win32-x86_64.jar"/>
</resources>
<resources os="Linux" arch="i386">
<j2se java-vm-args="-Xmx512m" version="1.5+"/>
<jar href="lib/swt-linux-x86.jar"/>
<nativelib href="lib/swt-linux-x86.jar"/>
</resources>
<resources os="Linux" arch="amd64">
<j2se java-vm-args="-Xmx512m" version="1.5+"/>
<jar href="lib/swt-linux-x86_64.jar"/>
<nativelib href="lib/swt-linux-x86_64.jar"/>
</resources>
<resources os="Mac OS X" arch="x86_64">
<j2se java-vm-args="-XstartOnFirstThread -Xmx512m" version="1.5+"/>
<jar href="lib/swt-macos-x86_64.jar"/>
</resources>
<resources os="Mac OS X" arch="x86">
<j2se java-vm-args="-XstartOnFirstThread -Xmx512m" version="1.5+"/>
<jar href="lib/swt-macos.jar"/>
</resources>
If I understand correctly, this should result in on windows (depending on the arch) only the swt-win32-x86.jar being loaded. But when I launch the application on windows 7 64bit, but with a 32bit jvm I get the following error: NativeSwing[1]: Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: NativeSwing[1]: no swt-gtk-4234 in java.library.path NativeSwing[1]: no swt-gtk in java.library.path NativeSwing[1]: Can't load library: C:\Users\dolf.swt\lib\win32\x86\swt-gtk-4234.dll NativeSwing[1]: Can't load library: C:\Users\dolf.swt\lib\win32\x86\swt-gtk.dll
Of course no swt-gtk can be found on Windows, it should only be needed on Linux. If I check the Resources in the java control panel under the temporary internet files viewer of java, I indeed see both swt-linux-x86.jar and swt-win32-x86.jar have been downloaded by java webstart. Clearly, java webstart is downloading the wrong jar files.
I hope anyone has an idea why this is going wrong.