title: How do I check jar file dependencies
body: <p>I am coming from .NET background and I need to do some JAVA work these days. One thing I don't quite understand is how JAvA runtime resolve its jar dependencies. For example, I want to use javax.jcr to do some node adding. So I know I need to add these two dependencies because I need to use javax.jcr.Node and org.apache.jackrabbit.commons.JcrUtils.</p>
  
  <pre><code>      &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;dependency&gt;
             &lt;groupId&gt;org.apache.jackrabbit&lt;/groupId&gt;
             &lt;artifactId&gt;jackrabbit-jcr-commons&lt;/artifactId&gt;
             &lt;version&gt;2.8.0&lt;/version&gt;
        &lt;/dependency&gt;
            &lt;/dependency&gt;
  </code></pre>
  
  <p>Now I passed the compilation but I get an exception in runtime. Then someone told me to add one more dependency which solves the problem.</p>
  
  <pre><code>         &lt;dependency&gt;
                 &lt;groupId&gt;org.apache.jackrabbit&lt;/groupId&gt;
                 &lt;artifactId&gt;jackrabbit-jcr2dav&lt;/artifactId&gt;
                 &lt;version&gt;2.6.0&lt;/version&gt;
            &lt;/dependency&gt;
  </code></pre>
  
  <p>From my understanding, jackrabbit-jcr-commons needs jackrabbit-jcr2dav to run.  If the jar misses a dependecy, how can it pass the compilation? And also how do I know I miss this particular dependency from jcr-common? This is a general question, it doesn't have to be specific to java jcr.</p>