title: Installing the Java ZeroMQ binding (jzmq) using Maven, Missing Native Code Library
body: <p>I am attempting to install jzmq, the Java ZeroMQ binding, from the Maven repository (<a href="http://search.maven.org/#search|ga|1|a%3A%22jzmq%22">http://search.maven.org/#search|ga|1|a%3A%22jzmq%22</a>).  When added as a dependency to my pom.xml[1] Maven downloads the main jar, which provides a Java library, as expected. In addition to the main library, jzmq requires a native code library which Maven does not appear to download. At run time the Java library raises an exception due to the missing native code library. </p>
  
  <p>The native library is provided in the repository and the pom.xml[2] file for jzmq appears to specify that the native library (libjzmq.so) should be downloaded. If I download the library and set the native library location manually it all works, I would however prefer if this could be automated via Maven.  </p>
  
  <p>I am unsure as to why Maven is not downloading and installing the native library, any advice or suggestions as to how to resolve this problem would be greatly appreciated. </p>
  
  <p>I am running the latest Ubuntu release using OpenJDK and Apache Maven 3.0.4</p>
  
  <p>[0] The exception that is raised when using jzmq as provided by Maven, sans the crucial native code library.</p>
  
  <pre><code>Exception in thread "main" java.lang.UnsatisfiedLinkError: no jzmq in java.library.path
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1874)
      at java.lang.Runtime.loadLibrary0(Runtime.java:849)
      at java.lang.System.loadLibrary(System.java:1087)
      at org.zeromq.ZMQ.&lt;clinit&gt;(ZMQ.java:39)
  </code></pre>
  
  <p>[1] My pom.xml where jzmq is added as a dependency</p>
  
  <pre><code>&lt;dependency&gt;
  &lt;GroupId&gt;org.zeromq&lt;/groupId&gt;
  &lt;artifactId&gt;jzmq&lt;/artifactId&gt;
  version&gt;2.2.2&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>[2] The pom.xml for jzmq where the native library is referred to </p>
  
  <pre><code>&lt;profile&gt;
  &lt;id&gt;Linux&lt;/id&gt;
  &lt;activation&gt;
  &lt;property&gt;
  &lt;name&gt;os.name&lt;/name&gt;
  &lt;value&gt;Linux&lt;/value&gt;
  &lt;/property&gt;&lt;/activation&gt;
  &lt;properties&gt;
  &lt;native.os&gt;${os.name}&lt;/native.os&gt;
  &lt;native.path&gt;src/.libs/libjzmq.so&lt;/native.path&gt;
  &lt;!-- Use platform-specific path separators here: --&gt;
  &lt;native.library-path&gt;src/.libs/&lt;/native.library-path&gt;
  &lt;/properties&gt;
  &lt;/profile&gt;
  </code></pre>