zeromq java 教程,如何使用Java运行ZeroMQ?

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

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.

Thank you.

解决方案

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值