I\'ve got this error message when I compiled a Java file :
error: package javax.servlet does not exist
I installed a big .SH file for Jave
A Windows User:
I faced this problem myself and here is the solution that worked fine
Just Add this path to your CLASSPATH environmental variable "C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\servlet-api.jar"
The path before the jar name can differ based on your installation. Just go to your lib folder of tomcat and copy the whole directory.
More info for beginners: You can find Environmental variables here MyComputer -> Properties ->Advanced Settings -> Advanced tab
Now you can simply go to cmd prompt and type "javac Myclass.java"
Hope this helps!