what webserver are you using? If you are using
Tomcat 4.0 I have experienced similar problems..see my post in this forum under compiling servlets under Tomcat 4.0.
In case you arent using tomcat 4.0, try locating the servlet.jar file and explicitly mention it in the classpath option when you compile. I have found that it works.
ex javac -classpath "path to servlet.jar" yourfile.java
hope this helps
Sagar