title: package javax.servlet does not exist - ubuntu, tomcat
body: <p>echo $CLASSPATH</p>
  
  <pre><code>  /home/user/tomcat/lib/server-api.jar
  </code></pre>
  
  <p>echo $JAVA_HOME</p>
  
  <pre><code>  .:/usr/lib/jvm/java-6-sun
  </code></pre>
  
  <p>but when I try to compile .java which are in class folder</p>
  
  <pre><code>  javac  *.java
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>  HelloServlet.java:2: package javax.servlet does not exist
  </code></pre>
  
  <p>and additional 5 similar errors.</p>
  
  <p>I get no errors when</p>
  
  <pre><code>  javac -cp /home/user/tomcat/lib/servlet-api.jar *.java
  </code></pre>
  
  <p>Why is that? What should I change to make it work without -cp /path?</p>