title: Java Will Not Compile Objects Created by Me
body: <p>I have recently been getting this Java compile error every time I try to compile code that creates an instance of a class that I have created.  I've tried compiling manually, compiling from a different location, and even tried compiling in safe mode.  I  have also completely reinstalled Java on my computer.  Here's an example of code I write and the error I always get:<br>
  <strong>Instance creator class:</strong></p>
  
  <pre><code>public class Nothing {
      public static void main(String args[]) {
          Can World = new Can();
      }
  }
  </code></pre>
  
  <p><strong>Instantiated class:</strong></p>
  
  <pre><code>public class Can {
      public Can() {
          System.out.println("Test");
      }
  }
  </code></pre>
  
  <p><strong>The compile error:</strong></p>
  
  <pre><code>Nothing.java:4: cannot find symbol
  symbol  : class Can
  location: class Nothing
          Can World = new Can();
          ^
  Nothing.java:4: cannot find symbol
  symbol  : class Can
  location: class Nothing
          Can World = new Can();
                          ^
  2 errors
  </code></pre>
  
  <p>Someone who knows Java better than me has tried to compile files that I have had problems with with no success.  Also, when I run the code from within Eclipse, my IDE, it runs like it should.  </p>
  
  <p>Any suggestions at all or solutions would really, really be appreciated.  I would really hate something like this to be the thing that prevents me from programming.  Thanks again.</p>
  
  <p><em>EDIT:</em> I used to be able to compile the classes like this, until only recently I started receiving this error. I am compiling using an external tool I have created in the Eclipse IDE, but I have also tried compiling simply by navigating to the directory the two files are in in a CMD window and used javac Nothing.java yet the same error arises. I have also tried compiling Can.java first (which compiles), and then Nothing.java, but this fails as well.  Here is the text that I get when compiling from a CMD window:</p>
  
  <pre><code>02/09/2011  06:44 PM    &lt;DIR&gt;          .
  02/09/2011  06:44 PM    &lt;DIR&gt;          ..
  02/09/2011  03:45 PM               289 .classpath
  02/09/2011  03:45 PM               382 .project
  02/09/2011  03:45 PM    &lt;DIR&gt;          .settings
  02/09/2011  06:00 PM                75 Can.java
  02/09/2011  05:49 PM               102 Nothing.java
                 4 File(s)            848 bytes
                 3 Dir(s)  64,669,216,768 bytes free
  
  C:\Users\Alex\Mindstorms\NXT\leJOS NXJ\Moment&gt;javac Nothing.java
  Nothing.java:4: cannot find symbol
  symbol  : class Can
  location: class Nothing
                  Can World = new Can();
                  ^
  Nothing.java:4: cannot find symbol
  symbol  : class Can
  location: class Nothing
                  Can World = new Can();
                                  ^
  2 errors
  </code></pre>