title: Class Not Found Exception when I try to run the program
body: <p>I used <code>mvn install</code> to download all the dependencies for a java bundle. Then I wrote the test program and compiled it. It compiled without errors. But when I try to run it, it throws a run time exception:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/Module
      at Tester.main(Tester.java:8)
      Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.Module
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 1 more
  </code></pre>
  
  <p>Here is the target directory:</p>
  
  <p><a href="https://i.stack.imgur.com/hTgVw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hTgVw.png" alt="enter image description here"></a></p>
  
  <p>I have placed my <code>Tester</code> class immediately inside <code>classes</code> directory. I have verified that <code>com/fasterxml/jackson/databind/Module</code> exists in the lib directory.</p>
  
  <p><a href="https://i.stack.imgur.com/Gupov.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gupov.png" alt="enter image description here"></a></p>
  
  <p>What could be the reason for this?</p>
  
  <p>Here is the <code>pom.xml</code> that came with the java bundle:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;io.swagger&lt;/groupId&gt;
  &lt;artifactId&gt;swagger-java-client&lt;/artifactId&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  &lt;name&gt;swagger-java-client&lt;/name&gt;
  &lt;version&gt;1.0.0&lt;/version&gt;
  
  &lt;prerequisites&gt;
    &lt;maven&gt;2.2.0&lt;/maven&gt;
  &lt;/prerequisites&gt;
  
  &lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
        &lt;version&gt;2.12&lt;/version&gt;
        &lt;configuration&gt;
          &lt;systemProperties&gt;
            &lt;property&gt;
              &lt;name&gt;loggerPath&lt;/name&gt;
              &lt;value&gt;conf/log4j.properties&lt;/value&gt;
            &lt;/property&gt;
          &lt;/systemProperties&gt;
          &lt;argLine&gt;-Xms512m -Xmx1500m&lt;/argLine&gt;
          &lt;parallel&gt;methods&lt;/parallel&gt;
          &lt;forkMode&gt;pertest&lt;/forkMode&gt;
        &lt;/configuration&gt;
      &lt;/plugin&gt;
      &lt;plugin&gt;
        &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
        &lt;executions&gt;
          &lt;execution&gt;
            &lt;phase&gt;package&lt;/phase&gt;
            &lt;goals&gt;
              &lt;goal&gt;copy-dependencies&lt;/goal&gt;
            &lt;/goals&gt;
            &lt;configuration&gt;
              &lt;outputDirectory&gt;${project.build.directory}/lib&lt;/outputDirectory&gt;
            &lt;/configuration&gt;
          &lt;/execution&gt;
        &lt;/executions&gt;
      &lt;/plugin&gt;
  
      &lt;!-- attach test jar --&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
        &lt;version&gt;2.2&lt;/version&gt;
        &lt;executions&gt;
          &lt;execution&gt;
            &lt;goals&gt;
              &lt;goal&gt;jar&lt;/goal&gt;
              &lt;goal&gt;test-jar&lt;/goal&gt;
            &lt;/goals&gt;
          &lt;/execution&gt;
        &lt;/executions&gt;
        &lt;configuration&gt;
        &lt;/configuration&gt;
      &lt;/plugin&gt;
  
      &lt;plugin&gt;
        &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
        &lt;artifactId&gt;build-helper-maven-plugin&lt;/artifactId&gt;
        &lt;version&gt;1.10&lt;/version&gt;
        &lt;executions&gt;
          &lt;execution&gt;
            &lt;id&gt;add_sources&lt;/id&gt;
            &lt;phase&gt;generate-sources&lt;/phase&gt;
            &lt;goals&gt;
              &lt;goal&gt;add-source&lt;/goal&gt;
            &lt;/goals&gt;
            &lt;configuration&gt;
              &lt;sources&gt;
                &lt;source&gt;src/main/java&lt;/source&gt;
              &lt;/sources&gt;
            &lt;/configuration&gt;
          &lt;/execution&gt;
          &lt;execution&gt;
            &lt;id&gt;add_test_sources&lt;/id&gt;
            &lt;phase&gt;generate-test-sources&lt;/phase&gt;
            &lt;goals&gt;
              &lt;goal&gt;add-test-source&lt;/goal&gt;
            &lt;/goals&gt;
            &lt;configuration&gt;
              &lt;sources&gt;
                &lt;source&gt;src/test/java&lt;/source&gt;
              &lt;/sources&gt;
            &lt;/configuration&gt;
          &lt;/execution&gt;
        &lt;/executions&gt;
      &lt;/plugin&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
        &lt;version&gt;2.3.2&lt;/version&gt;
        &lt;configuration&gt;
          &lt;source&gt;1.6&lt;/source&gt;
          &lt;target&gt;1.6&lt;/target&gt;
        &lt;/configuration&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;dependencies&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;io.swagger&lt;/groupId&gt;
      &lt;artifactId&gt;swagger-annotations&lt;/artifactId&gt;
      &lt;version&gt;${swagger-annotations-version}&lt;/version&gt;
    &lt;/dependency&gt;
  
    &lt;!-- HTTP client: jersey-client --&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
      &lt;artifactId&gt;jersey-client&lt;/artifactId&gt;
      &lt;version&gt;${jersey-version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;com.sun.jersey.contribs&lt;/groupId&gt;
      &lt;artifactId&gt;jersey-multipart&lt;/artifactId&gt;
      &lt;version&gt;${jersey-version}&lt;/version&gt;
    &lt;/dependency&gt;
  
    &lt;!-- JSON processing: jackson --&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
      &lt;version&gt;${jackson-version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-annotations&lt;/artifactId&gt;
      &lt;version&gt;${jackson-version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
      &lt;version&gt;${jackson-version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.jaxrs&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-jaxrs-json-provider&lt;/artifactId&gt;
      &lt;version&gt;${jackson-version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.datatype&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-datatype-joda&lt;/artifactId&gt;
      &lt;version&gt;2.1.5&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;joda-time&lt;/groupId&gt;
      &lt;artifactId&gt;joda-time&lt;/artifactId&gt;
      &lt;version&gt;${jodatime-version}&lt;/version&gt;
    &lt;/dependency&gt;
  
    &lt;!-- Base64 encoding that works in both JVM and Android --&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;com.brsanthu&lt;/groupId&gt;
      &lt;artifactId&gt;migbase64&lt;/artifactId&gt;
      &lt;version&gt;2.2&lt;/version&gt;
    &lt;/dependency&gt;
  
    &lt;!-- test dependencies --&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;junit&lt;/groupId&gt;
      &lt;artifactId&gt;junit&lt;/artifactId&gt;
      &lt;version&gt;${junit-version}&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  &lt;properties&gt;
    &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;swagger-annotations-version&gt;1.5.8&lt;/swagger-annotations-version&gt;
    &lt;jersey-version&gt;1.18&lt;/jersey-version&gt;
    &lt;jackson-version&gt;2.4.2&lt;/jackson-version&gt;
    &lt;jodatime-version&gt;2.3&lt;/jodatime-version&gt;
    &lt;maven-plugin-version&gt;1.0.0&lt;/maven-plugin-version&gt;
    &lt;junit-version&gt;4.8.1&lt;/junit-version&gt;
  &lt;/properties&gt;
  </code></pre>
  
  <p></p>
  
  <p>Manifest file: (jackson-databind-2.4.2.jar)</p>
  
  <pre><code>Manifest-Version: 1.0
      Bnd-LastModified: 1407990182364
      Build-Jdk: 1.7.0_55
      Built-By: tatu
      Bundle-Description: General data-binding functionality for Jackson: work
       s on core streaming API
      Bundle-DocURL: http://wiki.fasterxml.com/JacksonHome
      Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
      Bundle-ManifestVersion: 2
      Bundle-Name: jackson-databind
      Bundle-SymbolicName: com.fasterxml.jackson.core.jackson-databind
      Bundle-Vendor: FasterXML
      Bundle-Version: 2.4.2
      Created-By: Apache Maven Bundle Plugin
      Export-Package: com.fasterxml.jackson.databind;version="2.4.2",com.faste
       rxml.jackson.databind.annotation;version="2.4.2",com.fasterxml.jackson.
       databind.cfg;version="2.4.2",com.fasterxml.jackson.databind.deser;versi
       on="2.4.2",com.fasterxml.jackson.databind.deser.impl;version="2.4.2",co
       m.fasterxml.jackson.databind.deser.std;version="2.4.2",com.fasterxml.ja
       ckson.databind.exc;version="2.4.2",com.fasterxml.jackson.databind.ext;v
       ersion="2.4.2",com.fasterxml.jackson.databind.introspect;version="2.4.2
       ",com.fasterxml.jackson.databind.jsonschema;version="2.4.2",com.fasterx
       ml.jackson.databind.jsonFormatVisitors;version="2.4.2",com.fasterxml.ja
       ckson.databind.jsontype;version="2.4.2",com.fasterxml.jackson.databind.
       jsontype.impl;version="2.4.2",com.fasterxml.jackson.databind.module;ver
       sion="2.4.2",com.fasterxml.jackson.databind.node;version="2.4.2",com.fa
       sterxml.jackson.databind.ser;version="2.4.2",com.fasterxml.jackson.data
       bind.ser.impl;version="2.4.2",com.fasterxml.jackson.databind.ser.std;ve
       rsion="2.4.2",com.fasterxml.jackson.databind.type;version="2.4.2",com.f
       asterxml.jackson.databind.util;version="2.4.2"
      Implementation-Build-Date: 2014-08-13 21:22:55-0700
      Implementation-Title: jackson-databind
      Implementation-Vendor: FasterXML
      Implementation-Vendor-Id: com.fasterxml.jackson.core
      Implementation-Version: 2.4.2
      Import-Package: com.fasterxml.jackson.annotation;version="[2.4.0,2.5)",c
       om.fasterxml.jackson.core;version="[2.4.2,2.5)",com.fasterxml.jackson.c
       ore.base;version="[2.4.2,2.5)",com.fasterxml.jackson.core.format;versio
       n="[2.4.2,2.5)",com.fasterxml.jackson.core.io;version="[2.4.2,2.5)",com
       .fasterxml.jackson.core.json;version="[2.4.2,2.5)",com.fasterxml.jackso
       n.core.type;version="[2.4.2,2.5)",com.fasterxml.jackson.core.util;versi
       on="[2.4.2,2.5)",javax.xml.datatype,javax.xml.namespace,javax.xml.parse
       rs,org.w3c.dom,org.w3c.dom.bootstrap,org.w3c.dom.ls,org.xml.sax
      Specification-Title: jackson-databind
      Specification-Vendor: FasterXML
      Specification-Version: 2.4.2
      Tool: Bnd-1.50.0
      X-Compile-Source-JDK: 1.6
      X-Compile-Target-JDK: 1.6
  </code></pre>