title: java packages: cannot find symbol
body: <p>I'm having a strange error. I have 2 classes in the same package but they can't find each other. From what I remember, as long as the classes are in the same package, they should be able to call each other's methods. </p>
  
  <p>My code looks similar to this:</p>
  
  <p>in A.java:</p>
  
  <pre><code>package com.mypackage;
  public class A{
     public static int read(){
      //some code
     }
  }
  </code></pre>
  
  <p>in B.java:</p>
  
  <pre><code>package com.mypackage;
  public class B{
    public static void main(String args[]){
      int x = A.read();
    }
  }
  </code></pre>
  
  <p>and it's giving me a <code>cannot find symbol variable A</code> error.</p>
  
  <p>Both of these classes depend on some <code>.jar</code> files, but I've already included the path of those jars to <code>CLASSPATH</code> and <code>A.java</code> compiled fine, but B can't find A for some reasons...</p>
  
  <p>When I remove the <code>package com.mypackage;</code> in both classes then they compile fine. </p>