ZeroMQ Java Installation Problem
I'm trying to install ZeroMQ's Java library but I've been having problem. First error was ./configure complained about JAVA_HOME which everything seemed to be fine but I couldn't manage to solve it but I've found a particular solution in ZeroMQ's chat logs.
The suggested solution was;
JAVA_HO开发者_开发百科ME="/System/Library/Frameworks/JavaVM.framework/Home" ./configure
However it doesn't work for me. The error message I've been receiving is
checking for jni.h in /Library/Java/Home/include... configure: error: cannot find jni.h in /Library/Java/Home/include.
I've tried JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home" ./configure
and JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home" ./configure
as well but still no luck. I'd like to hear StackOverflowers' thoughts about how I can solve this.
Thanks.
Since I installed JDK1.7 from oracle, so I need to specify another JAVA_HOME
.
# prepare java home
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk/Contents/Home
cd $JAVA_HOME
sudo ln -s include Headers
# fix jni_md.h: No such file or directory problem during `make`
sudo cp include/darwin/* include/
cd -
# do real stuff
git clone http://github.com/zeromq/jzmq
cd jzmq
./autogen.sh
JAVAC=$JAVA_HOME/bin/javac ./configure
make
sudo make install
Then do a test with: (note: the first local_lat
will quit by itself after the test)
java -Djava.library.path=/usr/local/lib -classpath /usr/local/share/java/zmq.jar:perf/ local_lat tcp://127.0.0.1:5555 30 100 &
java -Djava.library.path=/usr/local/lib -classpath /usr/local/share/java/zmq.jar:perf/ remote_lat tcp://127.0.0.1:5555 30 100
Should got mean latency
printed.
What I did for the missing jni.h on Mac OSX Snow Leopard:
cd /Library/Java/Home
sudo ln -s /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Headers/ ./include
精彩评论