ZeroMQ 的java 插件

来源:互联网 发布:闪电邮mac版 编辑:程序博客网 时间:2024/05/23 01:26

有java程序要用ZeroQM,从ZeroMQ的port里得到数据。在以前的VM里设置过,但是把程序移动到新的VM里就出现了Error:

java.lang.UnsatisfiedLinkError: no jzmq in java.library.path


这里记录一下

首先到ZMQ官网,里面有详细的下载和安装信息 http://zeromq.org/bindings:java

这次的VM是ubuntu,所以和以前还有点儿小区别。在要安装的时候出现了错误:

autogen.sh: error: could not find pkg-config.  pkg-config is required to run autogen.sh.

sudo apt-get install pkg-config


之后又是:

autogen.sh: error: could not find libtool.  libtool is required to run autogen.sh.

然后是这个:

autogen.sh: error: could not find autoreconf.  autoconf and automake are required to run autogen.sh.


不行了,咋啥都缺呢,得想个招啊55555.。。。。


都搞完了还是不行:

aclocal: warning: autoconf input should be named 'configure.ac', not 'configure.in'

autom4te: cannot create autom4te.cache: No such file or directory

哦,原来是权限问题

sudo ./autogen.sh

就好了。

不知道哪搞错了,文件夹没颜色了,抓狂

root@hostname# vi ~/.bashrcexport LS_OPTIONS='--color=auto'eval "`dircolors`"alias ls='ls $LS_OPTIONS'

If you want to apply the changes, type the following in your home directory:

root@hostname# . .bashrc

找不到文件:

checking for ZeroMQ... yes

checking zmq.h usability... no

checking zmq.h presence... no

checking for zmq.h... no


sudo apt-get install libzmq-dev

sudo apt-get install g++


最后一步 mvn 

Tests in error: 

  ZMQTest.testKeyDecode:965 » ZMQ Operation not supported

  ZMQTest.testSendMoreRequestReplyOverTcp:382 » ZMQ Invalid argument

  ZMQTest.testKeyEncode:956 » ZMQ Operation not supported

  ZMQTest.testKeyEncodeDecode:972 » ZMQ Operation not supported

没关系,跳过不管就行。

echo CLASSPATH=/usr/local/share/java/zmq.jar:. >> ~/.bashrc

echo export LD_LIBRARY_PATH=/usr/local/lib > ~/.bashrc

source ~/.bashrc



再运行就能好使了


0 0
原创粉丝点击