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

Bruno D. Rodrigues bruno.rodrigues at litux.org
Sat Jan 4 22:41:51 CET 2014


I’ve just grabbed the latest version and indeed it’s weird what is happening.

make creates a jar file inside src/main/c++/zmq.jar, which has a wrong folder hierarchy, like you show, with a ../java.

but if you ignore that file and run mvn clean -Dmaven.test.skip, then there is a correct jar inside target/jzmq4-4.0.0-SNAPSHOT.jar

The test.skip is because one of the tests if failing for me.

I have no time right now but if no one else fixes this, I’ll try to help tomorrow or during the week.


On Jan 4, 2014, at 17:51, 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 --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140104/df4458af/attachment.sig>


More information about the zeromq-dev mailing list