运行以下命令安装 jzmq
git clone https://github.com/zeromq/jzmq.git
cd jzmq
./autogen.sh
./configure
touch src/classdist_noinst.stamp
cd src
CLASSPATH=.:./.:$CLASSPATH javac -d . org/zeromq/ZMQ.java org/zeromq/ZMQException.java org/zeromq/ZMQQueue.java org/zeromq/ZMQForwarder.java org/zeromq/ZMQStreamer.java
make
Making all in src
make[1]: Entering directory `/home/jzmq/src'
make all-am
make[2]: Entering directory `/home/jzmq/src'
/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -D_REENTRANT - D_THREAD_SAFE -I/usr/java/default/include -I/usr/java/default/include/linux -Wall -g -O2 -MT libjzmq_la-Socket.lo -MD -MP -MF .deps/libjzmq_la-Socket.Tpo -c -o libjzmq_la-Socket.lo `test -f 'Socket.cpp' || echo './'`Socket.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/java/default/include -I/usr/java/default/include/linux -Wall -g -O2 -MT libjzmq_la- Socket.lo -MD -MP -MF .deps/libjzmq_la-Socket.Tpo -c Socket.cpp -fPIC -DPIC -o .libs/libjzmq_la-Socket.o
Socket.cpp: In function ‘jint Java_org_zeromq_ZMQ_00024Socket_sendByteBuffer(JNIEnv*, _jobject*, _jobject*, jint)’:
Socket.cpp:576: error: cannot convert ‘jbyte*’ to ‘zmq_msg_t*’ for argument ‘2’ to ‘int zmq_send(void*, zmq_msg_t*, int)’
Socket.cpp: In function ‘jint Java_org_zeromq_ZMQ_00024Socket_recvByteBuffer(JNIEnv*, _jobject*, _jobject*, jint)’:
Socket.cpp:708: error: cannot convert ‘jbyte*’ to ‘zmq_msg_t*’ for argument ‘2’ to ‘int zmq_recv(void*, zmq_msg_t*, int)’
Socket.cpp: At global scope:
Socket.cpp:507: warning: ‘jboolean s_zerocopy_init(JNIEnv*, zmq_msg_t*, _jobject*, jint)’ defined but not used
make[2]: *** [libjzmq_la-Socket.lo] Error 1
make[2]: Leaving directory `/home/jzmq/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/jzmq/src'
make: *** [all-recursive] Error 1