title: NoClassDefFoundError - could not initialize class ...?
body: <p>I am getting an error while writing my simple test program:</p>
  
  <pre><code>package Xbee;
  
  import com.rapplogic.xbee.api.XBee;
  import com.rapplogic.xbee.api.XBeeException;
  
  public class XbeeTest {
  
      public static void main(String[] args) {
          // TODO Auto-generated method stub
  
          XBee xbee = new XBee();
  
          try {
              xbee.open("COM22", 9600);
          } catch (XBeeException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
      }
  
  }
  </code></pre>
  
  <p>I am getting the following:</p>
  
  <pre><code>java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
  Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXVersion
      at gnu.io.CommPortIdentifier.&lt;clinit&gt;(CommPortIdentifier.java:123)
      at com.rapplogic.xbee.RxTxSerialComm.openSerialPort(RxTxSerialComm.java:71)
      at com.rapplogic.xbee.RxTxSerialComm.openSerialPort(RxTxSerialComm.java:61)
      at com.rapplogic.xbee.api.XBee.open(XBee.java:140)
      at Xbee.XbeeTest.main(XbeeTest.java:14)
  </code></pre>
  
  <p>The whole problem is that it cannot initialize the class gnu.io.RXTXversion, which is a prt of rtxtcomm.jar, which I have included in my Maven dependency:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.bidib.jbidib.org.qbang.rxtx&lt;/groupId&gt;
      &lt;artifactId&gt;rxtxcomm&lt;/artifactId&gt;
      &lt;version&gt;2.2&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Any ideas? Thanks.</p>