[zeromq-dev] ZeroMQ Java Binding install -- issues & solution

Sean Robertson sprobertson at gmail.com
Sat Jan 4 20:52:40 CET 2014


Not a Java guru either but I think this is just how any Java classpath
works - it expects the directory structure to exactly mirror the package
name.

Maybe it's worthwhile having some compilation instructions in the
documentation (for javac etc. rather than just Maven)?
On Jan 4, 2014 9:51 AM, "Kiran Karra" <kiran.karra at gmail.com> wrote:

> 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
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140104/83dea5b8/attachment.htm>


More information about the zeromq-dev mailing list