I have a java application using an external dll (zmq). When I run it in debug mode in Eclipse it's all fine. However, when I export the application as Runnable JAR file then trying to run it, I'm getting that error referencing the dll. Following my research on this site I configured the build path for JRE System Library, added that path of the folder containing the dll to Native library location, but I'm still getting that error. Is there anything I need to do further? Or different? Thanks.
Asked
Active
Viewed 5,872 times
2
-
so this external jar exist in the runnabble jar ? – Kick Mar 01 '14 at 18:00
-
It's not external jar; it's external dll. – user3062233 Mar 01 '14 at 18:06
-
ohkk whatever file,so it exist in runnable jar ? – Kick Mar 01 '14 at 18:10
-
Should be. In the Export settings I selected "Package required libraries into generated jar". I also tried to select "Extract required libraries into generated JAR". Got the same error in both cases. – user3062233 Mar 01 '14 at 18:16
-
U can open the jar and check whatever files/classes exist in it.Mat b ur jar is not getting created properly – Kick Mar 01 '14 at 18:18
-
How do I do that (open the jar to check its content)? – user3062233 Mar 01 '14 at 18:21
-
open it using winrar or any decompiler – Kick Mar 01 '14 at 18:24
1 Answers
3
JZMQ needs two things to run: zmq.dll
(the native ZMQ library) and jzmq.dll
(the "bridge" library between Java and ZMQ). The particular error you are getting means your compile environment can't locate jzmq.dll
; you just need to specify the path where it can find jzmq.dll
. Note that, as far as I'm aware, there is no way for jzmq.dll
to be in a JAR file so you can just include it in your classpath.
Unfortunately, I can't tell you exactly how to do it in Windows. I come from Linux, where DLLs are SO files. There it would be a simple export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/jzmq
.

skytreader
- 11,467
- 7
- 43
- 61