title: Java jars unable to resolve class
body: <p>I'm relatively new to Java development...I thought I understood how class path works, but I must be missing something.</p>
  
  <p>Using Groovy, I have 2 external classes referenced by imports. When I execute the script, I get "unable to resolve class" errors. I have the jars for these in the same directory as the script. If I un-jar them, the script works, but jar'd up the script does not.</p>
  
  <p>What am I missing here?</p>
  
  <p>EXAMPLE</p>
  
  <pre><code>import org.apache.log4j.Logger
  
  Logger log = Logger.getLogger("ldap_delete")
  log.info("This is an informative log entry")
  </code></pre>
  
  <p>Putting log4j-1.2.17.jar in the same directory as the .groovy script does not work. Setting cp to . does not work. I have to do:</p>
  
  <pre><code>groovy -cp log4j-1.2.17.jar myscript.groovy
  </code></pre>
  
  <p>to get the class to load.</p>