title: ZeroMQ Java example hangs on Ubuntu 12
body: <p>I'm trying to program with ZeroMQ on Ubuntu using the Java examples. I've successfully built ZeroMq core and Java bindings, but trying to run simple example, it just hangs indefinitely. </p>
  
  <p>Here's what I've done so far, btw, I'm using <code>JDK/JRE 1.7</code>, <code>ZeroMQ 3.2.2</code>, and <code>Ubuntu 12.10 64-bit</code></p>
  
  <p><strong>Build ZeroMQ Core Libraries</strong></p>
  
  <p>I downloaded core ZeroMQ 3.2.2 POSIX tarball from <a href="http://download.zeromq.org/zeromq-3.2.2.tar.gz" rel="nofollow">here</a>, extracted and built according to instructions <a href="http://www.zeromq.org/area%3adownload" rel="nofollow">here</a>. Configure, make, and installation all went well, no errors, I also ran <code>ldconfig</code> following <code>make</code> to update the system library cache. A quick look at <code>/usr/local/lib</code> and the core libraries appear to have built correctly...</p>
  
  <pre><code>usr1@ubuntu:/usr/local/lib$ ls -ltr *.so
  lrwxrwxrwx 1 root dev 15 Apr  1 19:31 libzmq.so -&gt; libzmq.so.3.0.0
  lrwxrwxrwx 1 root dev 16 Apr  1 20:14 libjzmq.so -&gt; libjzmq.so.0.0.0
  </code></pre>
  
  <p><strong>Build JZMQ Java Bindings</strong></p>
  
  <p>Downloaded Java bindings source from <a href="http://github.com/zeromq/jzmq" rel="nofollow">here</a>, configured, ran make; all looks good. This creates <code>zmq.jar</code> and <code>zmq-perf.jar</code>; ran <code>ldconfig</code> again to update library cache; moved jars to <code>/usr/local/share/java</code>...</p>
  
  <pre><code>usr1@ubuntu:/usr/local/share/java$ ls -ltr
  -rw-r--r-- 1 usr1 usr1 40507 Apr  1 20:14 zmq.jar
  -rw-rw-r-- 1 usr1 usr1  4809 Apr  2 08:41 zmq-perf.jar
  </code></pre>
  
  <p><strong>Running Example <code>local_lat</code></strong></p>
  
  <p>I ran the <code>local_lat</code> example detailed <a href="http://www.zeromq.org/bindings%3ajava" rel="nofollow">here</a> using the following settings for my environment...</p>
  
  <pre><code>java -Djava.library.path=/usr/local/lib -classpath /usr/local/share/java/zmq-perf.jar:/usr/local/share/java/zmq.jar local_lat tcp://127.0.0.1:5555 1 100
  </code></pre>
  
  <p>Got <code>UnsatisfiedLinkError</code>; fixed that by just logging in and out.
  Ran again and it just hangs, no errors, nata, zilch. I removed the argument <code>100</code> from above and got the usage message from <code>local_lat</code>, so I know it's finding the zmq jar files since <code>local_lat</code> class resides in <code>zmq-perf.jar</code>. Ran again with the above command, and it just hangs; no errors, nothing. A bit of a let down since it was quite a bit of work to get everything built.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>See below, turns out this was a problem with how I was testing</p>