[zeromq-dev] ZeroMQ Java Binding install -- issues & solution
Kiran Karra
kiran.karra at gmail.com
Sat Jan 4 18:51:29 CET 2014
Hi All,
Apologies in advance if this has already been discussed before, but I
was trying to use ZeroMQ's Java Bindings. I am running MacOSX 10.9
(Mavericks), as well as ZeroMQ 4.0.3, and then downloaded the java
bindings from the github. I followed the directions:
$ ./autogen.sh
$ ./configure
$ make
$ make install
I then tried to use the zmq.jar, but noticed that I kept getting
import errors in Eclipse, that org.zeromq was not found. I looked at
the jar contents w/ jar tf zmq.jar (which is located in
/usr/local/share/java), and it showed:
Kirans-MacBook-Pro:java Kiran$ jar tf zmq.jar
META-INF/
META-INF/MANIFEST.MF
../java/org/zeromq/EmbeddedLibraryTools.class
../java/org/zeromq/ZContext.class
etc etc
I'm not a java guru, but I think the problem is that in my code, I am
trying to import org.zeromq.ZMQ (as was given in the samples on the
zmq website). However, the relative path specified by the jar is
throwing things off.
I regenerated the jar as follows:
First follow all the steps to compile the java sources (i.e., autogen,
configure, make).
Then:
1.) $ cd ~/jzmq-master/src/main/java
2.) $ jar cf zmq-kiran.jar org/zeromq/*.class
test it
3.)
sh-3.2# jar tf zmq-kiran.jar
META-INF/
META-INF/MANIFEST.MF
org/zeromq/EmbeddedLibraryTools.class
org/zeromq/ZContext.class
org/zeromq/ZDispatcher$1.class
The relative paths are now correct.
Using this jar, the imports and the java program now works ... Not
sure if this is a specific issue to my computer, or if it is general?
Kiran
More information about the zeromq-dev
mailing list