I'm having an issue running ZeroMQ with Java using Eclipse and Windows XP. I've successfully installed [I think] the 0MQ libraries as well as the Java bindings. The instructions I used to do that are located here.
Two files were built: zmq.jar and jzmq.dll. I placed the jar file in my project, which allowed the code to compile OK. I also set the java.library.path to the directory of the dll, added the perf directory to my project, and added libzmq.dll to my PATH. (All per the instructions).
I still get the following exception that I can't fix:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\jzmq\lib\jzmq.dll: Can't find dependent libraries
What other libraries is jzmq.dll dependent on? I've tried placing libzmq.dll everywhere but that didn't help. This is the code sample I'm trying to get working.
Thank you.
ZeroMQ sockets carry messages, like UDP, rather than a stream of bytes as TCP does. A ZeroMQ message is length-specified binary data.
ZeroMQ supports common messaging patterns (pub/sub, request/reply, client/server and others) over a variety of transports (TCP, in-process, inter-process, multicast, WebSocket and more), making inter-process messaging as simple as inter-thread messaging. This keeps your code clear, modular and extremely easy to scale.
ZeroMQ (also spelled ØMQ, 0MQ or ZMQ) is an asynchronous messaging library, aimed at use in distributed or concurrent applications. It provides a message queue, but unlike message-oriented middleware, a ZeroMQ system can run without a dedicated message broker; the zero in the name is for zero broker.
Put any dll in Windows root or Windows System32 is urgly solution, it just pull you into Dll HELL.
What you need to do is add the ZQM binary path in the System PATH.
I compiled a 64bit ZMQ & JZMQ in a hour, and here is my folder structure:
c:\ZMQ\bin --- jzmq.dll, libzmq.dll c:\ZMQ\lib --- ZMQ.jar
here is the step:
add the binray path into system enviromennt, detail steps is control panel -- system --- advance settings , and in the pop-up tab, find the 'advance' -- 'enviroment variables' --- find the 'PATH' in the 'system vairiabls' and add C:\ZMQ\bin in the value
open a dos prompt, and type 'where jzmq.dll' (I am not sure if where.exe exist in XP) to confirm if it is in the PATH now.
Start the Eclipse, and open your project, right click on your project name, and select in the menu 'build path -- add external archives ' choose the C:\ZMQ\lib\zMQ.jar.
All done!
In my PC, the example runs correctly.
You should copy libzmq.dll to the location pointed by java.library.path and use this:
System.loadLibrary("libzmq")
The reason is that jzmq depends on libzmq so libzmq has to be loaded first.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With