title: Package does not exist error
body: <p>I've just come back to fix some bugs in a small program that I've written, and now I can't compile because a package doesn't exist (according to javac).</p>
  
  <p>As far as I know, I haven't changed anything in my class path, or the contents of my directories. I don't know if there have been any Java updates in between.</p>
  
  <p>In my root directory, I have the four Java files that comprise my program. They don't have any package ascribed to them. Additionally, I have the directory structure <code>org\apache\commons\cli</code> in the root directory which contains the CLI java files from the Apache Commons. The Apache files do have a package ascribed that mirrors the directory structure in which they lie.</p>
  
  <p>If I issue the command <code>javac -verbose -d build CommandLine.java</code>, it fails with </p>
  
  <pre><code>CommandLine.java:28: package org.apache.commons.cli does not exist
  import org.apache.commons.cli.*;
  ^
  </code></pre>
  
  <p><code>CommandLine.java</code> is the entry point of the program.</p>
  
  <p>There is no attempt by the compiler to compile the CLI files, and if I compile them beforehand, the failure still takes place. Also, the CLI is also available in my classpath.</p>
  
  <p>I am running javac 1.6.0_12.</p>
  
  <p>What can I do/try?</p>
  
  <p>.</p>
  
  <p>EDITED FOR ANSWER:</p>
  
  <p>As accepted below, I altered the compilation command to be: </p>
  
  <pre><code>javac -verbose -d build -classpath . CommandLine.java
  </code></pre>
  
  <p>Now it works. Don't know why it did before, and why it stopped now though...</p>
  
  <p>.</p>
  
  <p>EDITED FOR CAUSE OF PROBLEM</p>
  
  <p>I installed a program that also used the CLASSPATH to run its own things. It changed the CLASSPATH that belonged to the user, but left the global one alone. I re-added the java classpath things back in and it works again!</p>