title: NoClassDefFoundError with Apache commons math
body: <p>I want to use the PoissonDistribution from Apache Commons but always get the error a <code>NoClassDefFoundError</code>.</p>
  
  <p>The code:</p>
  
  <pre><code>import org.apache.commons.math3.distribution.PoissonDistribution;
  
  public class Test {
  
      public static void main(String[] args) {
          PoissonDistribution p = new PoissonDistribution(5.0);
  
      }
  
  }
  </code></pre>
  
  <p>The error message:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/math3/distribution/PoissonDistribution
      at Test.main(Test.java:6)
  Caused by: java.lang.ClassNotFoundException: org.apache.commons.math3.distribution.PoissonDistribution
      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
      ... 1 more
  </code></pre>
  
  <p>What I've done so far:
  The commons-math3-3.6.1.jar file is located in a folder inside my project folder and via <code>Project-&gt;Properties-&gt;Java Build Path-&gt;Libraries</code> I added the JAR file and then in the "Order and Export" tab next to it I selected the jar file.</p>
  
  <p>Thanks for your help!</p>