tags:

views:

34

answers:

2

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'll need servlet.jar in your classpath.

DJ
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