I've installed 0MQ on a VM running CentOS and I have a C-based application happily working with it. However, I'm unable to get the Java application to work via JZMQ bindings. Here's 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 don't get any errors during installation of either 0MQ or JZMQ. I tried copying all libraries into /usr/local/lib but that didn't solve anything. Any ideas? This works on my Mac (so I know the JAR works), but not on the Linux box.
This is because ld.so cannot resolve your libzmq.so.1.0.0
.
Add the path /usr/local/lib
to /etc/ld.so.config
and run ldconfig
to rebuild the cache.