title: Package not found; javac
body: <p>This is annoying.</p>
  
  <p>I have a directory structure like this</p>
  
  <pre><code>-lib
     --some jar files
  
  -packageName
     --Main.java
     --SomeOtherPackage
        --SomeOtherJavaClass.java
  </code></pre>
  
  <p>Main.java imports <code>SomeOtherPackage</code>. And both java files uses jars in the lib.</p>
  
  <p>What I do is add the jar files independently in the CLASSPATH. And then run as:
  javac packageName/Main.java</p>
  
  <p>but it gives the error that Package not found <code>SomeOtherPackage</code> . Shouldn't it automatically realize the dependency and build <code>SomeOtherPackage</code> as well? What would be the javac command and the classpath for the above case?</p>
  
  <p>Thanks</p>