Because it is often a hassle to deploy DLL/so files, we
use a library that encapsulates the native library
location. If the DLL is in a JAR file, it is extracted to a
temporary location, then loaded.
The native library(ies) are stored in the classpath along
with the .class file, as follows:
com.trumpetinc.lib.NativeAPI
would have the following path:
com\trumpetinc\lib\NativeAPI.class
com\trumpetinc\lib\nativelib\win32\x86\NativeAPI.dll
com\trumpetinc\lib\nativelib\win32\alpha\NativeAPI.dll
etc...
The systray4j JAR would then have the following
structure:
snoozesoft\systray4j\NativeAPI.class
snoozesoft\systray4j\nativelib\win32\x86\systray4j.dll
... you'll have to add the KDE dll - I don't have that to
test with...
The attached patch adds two utility classes that
encapsulate this behavior, and makes 2 small tweaks to
the NativeSysTray class to get it to work this way. It
also places a copy of the NativeAPI.dll file in the correct
location.
I then jar up the systray4j library, and include the dlls -
much easier deployment (it also works if the files aren't
in a JAR for development work).
Cheers,
Kevin
Patch for including native DLL in jar