title: Jackrabbit FirstHop example java.lang.NoClassDefFoundError
body: <p>I am trying with Jackrabbit FirstHops example given on Apache site but I am getting below error when trying to run.</p>
  
  <pre><code>S:\mvnapp\FirstHop2&gt;java -cp target\FirstHop2-1.0-SNAPSHOT.jar org.shobhan.jr.Fi
  rstHopSB
  Exception in thread "main" java.lang.NoClassDefFoundError: javax/jcr/Credentials
  
      Caused by: java.lang.ClassNotFoundException: javax.jcr.Credentials
              at java.net.URLClassLoader$1.run(Unknown Source)
              at java.security.AccessController.doPrivileged(Native Method)
              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)
              at java.lang.ClassLoader.loadClassInternal(Unknown Source)
      Could not find the main class: org.shobhan.jr.FirstHopSB.  Program will exit.
  </code></pre>
  
  <p>Below is Pom.xml file, i have added the dependencies as provided on apache site.</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/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;org.shobhan.jr&lt;/groupId&gt;
    &lt;artifactId&gt;FirstHop2&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
  
    &lt;name&gt;FirstHop2&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
  
      &lt;dependencies&gt; 
      &lt;!-- The JCR API --&gt; 
          &lt;dependency&gt; 
              &lt;groupId&gt;javax.jcr&lt;/groupId&gt; 
              &lt;artifactId&gt;jcr&lt;/artifactId&gt; 
              &lt;version&gt;2.0&lt;/version&gt; 
          &lt;/dependency&gt; 
          &lt;!-- Jackrabbit content repository --&gt; 
          &lt;dependency&gt; 
              &lt;groupId&gt;org.apache.jackrabbit&lt;/groupId&gt; 
              &lt;artifactId&gt;jackrabbit-core&lt;/artifactId&gt; 
              &lt;version&gt;2.9.0&lt;/version&gt; 
          &lt;/dependency&gt; 
          &lt;!-- Use Log4J for logging --&gt; 
          &lt;dependency&gt; 
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt; 
              &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt; 
              &lt;version&gt;1.7.5&lt;/version&gt; 
          &lt;/dependency&gt; 
      &lt;/dependencies&gt; 
  &lt;/project&gt;
  </code></pre>
  
  <p>My env. has below values.</p>
  
  <p>CLASSPATH=C:\Program Files\Java\jdk1.6.0_17\bin;S:\JR\jackrabbit-standalone-2.8.0.jar JAVA_HOME=C:\Program Files\Java\jdk1.6.0_17</p>
  
  <p>M2_HOME=S:\maven\apache-maven-3.2.5 PATH=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;S:\maven\apache-maven-3.2.5\bin;C:\Program Files\Java\jdk1.6.0_17\bin</p>