0

I am trying to build a SWING application in which I use a dll to get data from a device connected via USB. I used JNA to interface dll into JAVA and I was successful in doing so when I run the application from Eclipse. But the issue is when i package this into an executable JAR and I try to run in the same machine I am getting

UnsatisfiedLinkError: Unable to load library 'test.dll': The specified module could not be found
at com.sun.jna.NativeLibrary.loadLibrary NativeLibrary.java :169
at com.sun.jna.NativeLibrary.getInstance NativeLibrary.java :242

I was loading the dll using

        driverDLL INSTANCE = (driverDLL) Native.loadLibrary((Platform.isWindows() ? "test" : "simpleDLLLinuxPort"), driverDLL.class);
            int start();

I did not find any issue while running an application in eclipse but im always running into exception when i run it as executable jar in the same machine. Please help

raajesh
  • 21
  • 2
  • possible duplicate of [How to bundle a native library and a JNI library inside a JAR?](http://stackoverflow.com/questions/2937406/how-to-bundle-a-native-library-and-a-jni-library-inside-a-jar) – Sneftel Dec 10 '13 at 09:24
  • Hi Sneftel, no this is not the one which i think. I am not trying to export the whole into new system and run.Instead I am trying to run the JAR file in the same system where I have the dll in the library path. One thing which confuses me is why the same project when run from Eclipse was able to load the dll whereas when i run it as JAR it fails to load – raajesh Dec 11 '13 at 02:48

0 Answers0