不要从 brew 直接安装,从 brew 安装的,jzmq 编译不通过。

install libzmq

see https://github.com/zeromq/libzmq/blob/master/INSTALL

git clone https://github.com/zeromq/libzmq
cd libzmq
sudo ./autogen.sh
sudo ./configure
sudo make
sudo make check
sudo make install

遇到问题No package 'libsodium' found

https://kerpanic.wordpress.com/2015/07/09/zero-mq-installation-package-requirements-libsodium-were-not-met/

配置的时候不包含这个库即可

./configure --without-libsodium

install jzmq

git clone https://github.com/zeromq/jzmq
cd jzmq
sudo ./autogen.sh
sudo ./configure
sudo make
sudo make install

use in idea

However you run your code, you’ll want to pass the following flag to the VM as an arg. It tells it where to find the native lib
-Djava.library.path=/usr/local/lib
In Intellij, this is in Run > Edit Configurations > New > VM Parameters

参考:

http://cbcg.net/blog/2011/07/30/getting-zeromq-and-jzmq-running-on-mac-os-x/

Comments
Write a Comment