0MQ - Unsatisfied JZMQ communication error

I installed 0MQ on a CentOS-based virtual machine, and I have a C-based application that works with it with pleasure. However, I cannot get a Java application to work with JZMQ bindings. Here is the error I get:

java -Djava.library.path=/usr/local/lib -jar AidApps.jar receive localhost:9007
Starting the receiver application.
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/lib/libjzmq.so.0.0.0: libzmq.so.1: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1750)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1675)
at java.lang.Runtime.loadLibrary0(Runtime.java:840)
at java.lang.System.loadLibrary(System.java:1047)
at org.zeromq.ZMQ.<clinit>(ZMQ.java:34)
at com.ijet.Receiver.main(Receiver.java:9)
at com.ijet.Main.main(Main.java:13)

I have no errors when installing 0MQ or JZMQ. I tried to copy all the libraries to / usr / local / lib, but that didn't solve anything. Any ideas? This works on my Mac (so I know the JAR works), but not in the Linux box.

+5
source share
2 answers

This is because ld.so cannot resolve yours libzmq.so.1.0.0.

Add a path /usr/local/libto /etc/ld.so.configand run ldconfigto rebuild the cache.

+7
source

( J16-SDiZ):

1) cp /root/zeromq-2.1.11/src/.libs/*.* /usr/local/lib
2) nano /etc/ld.so.conf.d/zmq.conf
3) /usr/local/lib 4) ldconfig
5) , ldconfig -v | grep zmq
6) JAR java -Djava.library.path=/usr/local/lib/ -jar AidApps.jar receive localhost:9007

, -Djava.library.path, jzmq.jar.

+10

All Articles