Can anyone please help me with compiling servlet? Do I have to include path for JDK or Tomcat or both to compile servlet in command prompt?
A:
You obviously need to include at least the Servlet API in the classpath. Tomcat has it in flavor of servlet-api.jar
in its /lib
folder.
So you basically need to compile your servlets like:
javac -cp .;c:/path/to/tomcat/lib/servlet-api.jar com/example/SomeServlet.java
BalusC
2009-12-02 11:45:54