title: Does classpath definition in Manifest.mf override or supplement library-path in EARs?
body: <p>I'm having a difference of opinion with another developer (as well as empirical evidence) regarding the use of Class-Path in MANIFEST.MF.</p>
  
  <p>I have an EAR with a bunch of jars in my /lib folder.  In my application.xml I have defined my <code>&lt;library-path&gt;</code> to be /lib, however I believe that is the default setting/value anyhow.</p>
  
  <p>In my root, I have an <code>my-ejb.jar</code> file.  Within the EJB, I have a MANIFEST.MF with a Class-Path entry.  </p>
  
  <p>So the questions now are:</p>
  
  <ol>
  <li>If a classpath entry is found in the EJB manifest, does the classloader still have access to all the jars/libs that are in /lib even if they are not explicitly specified in the manifest?  </li>
  <li>If no classpath entry is found in the manifest, does the EJB have access to any/all jars in /lib?</li>
  <li>If a jar is specified in the manifest in a different location than /lib, does it take precedence over what is found in /lib?</li>
  <li>How does a classloader resolve an issue where there are entries in the manifest for non-existant jars?</li>
  <li>Are all these rules dependent on the container implementation, or are these part of the java specs somewhere (I haven't been able to find it anywhere).</li>
  </ol>
  
  <p>Part of the issue comes up due to a third-party EJB that I am using with a Manifest that is poorly written (looking for libs in the root folder, non-existant jars, etc).  So I can rewrite the manifest, however, I also question how this would work in the case of a signed EJB jar.  Would I be able to move a dependency lib from the location as defined the the manifest?</p>