If you're running
Tomcat, you already have the servlet.jar file you need. You only need to point your classpath to it.
One caveat: I just found (after hours of teeth-gnashing) that at least on NT, you can't use environment variables as tokens in other variables and have Java be able to follow it. Example:
- let's say you have TOMCAT_HOME set to 'd:\jakarta-tomcat-3.2.2'
- don't put '%TOMCAT_HOME%\lib\servlet.jar' in your CLASSPATH and expect it to work when compiling Java source that needs that .jar file. You instead have to put 'd:\jakarta-tomcat-3.2.2\lib\servlet.jar' in your classpath.
When I did this, compilation errors arising from javac not finding javax.servlet.* stopped.