zeromq/cljzmq

need to add jzmq dependency manually?

marianoguerra opened this issue · 7 comments

if I create a project and add the cljzmq dep and try to require it, it fails trying to load jzmq, if I add it to the deps with something like:

:dependencies [[org.clojure/clojure "1.5.1"]                                 
             [org.zeromq/jzmq "2.2.1"]                                     
             [org.zeromq/cljzmq "0.1.1"]] 

it fails in the repl with

user=> (require '[zeromq.zmq :as zmq])

UnsatisfiedLinkError no jzmq in java.library.path  java.lang.ClassLoader.loadLibrary (ClassLoader.java:1856)

which is the recommended way to make it work?

We typically do a manual installation of jzmq (instructions are here), and then add the following snippit to your project.clj file (changing the path as needed) for leinigen to pick up the dependencies:

:jvm-opts ["-Djava.library.path=/usr/lib:/usr/local/lib"] 

ok, it doesn't work with jeromq right?

just trying to find a way to avoid having to install zeromq manually :)

jeromq is a drop in replacement for jzmq.

Adding the following to your project.clj file should do the trick:

  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.jeromq/jeromq "0.2.0"]
                 [org.zeromq/cljzmq "0.1.1" :exclusions [org.zeromq/jzmq]]]

edit: fix typo

The org.zeromq mirroring (instead of org.jeromq) didn't happen until after 0.2.0. There needs to be a release of jeromq 0.3.0 before this is a viable replacement.

This should do the trick:

  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.jeromq/jeromq "0.3.0-SNAPSHOT"]
                 [org.zeromq/cljzmq "0.1.1" :exclusions [org.zeromq/jzmq]]]
  :repositories {"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/"}

I think you want:

:repositories {"sonatype-nexus-snapshots" "https://oss.sonatype.org/content/repositories/snapshots"}

But yeah, same idea. I think it's time for a 0.3.0 release though :).

good enough for me, maybe it would be useful for others if this was in the readme :)