Hi,
I am trying to compile a simple servlet, I have attached the servlet code, and the ant file however the following is the error message.
/****************** error message *************/
build:
[javac] Compiling 1 source file to /home/asarkar/Development/anttest/example2/build/src
[javac] /home/asarkar/Development/anttest/example2/src/HelloWorld.java:9: package javax.servlet does not exist
[javac] import javax.servlet.*;
[javac] ^
[javac] /home/asarkar/Development/anttest/example2/src/HelloWorld.java:10: package javax.servlet.http does not exist
[javac] import javax.servlet.http.*;
[javac] ^
[javac] /home/asarkar/Development/anttest/example2/src/HelloWorld.java:14: cannot resolve symbol
[javac] symbol : class HttpServlet
[javac] location: class HelloWorld
[javac] public class HelloWorld extends HttpServlet {
[javac] ^
[javac] /home/asarkar/Development/anttest/example2/src/HelloWorld.java:17: cannot resolve symbol
[javac] symbol : class HttpServletRequest
[javac] location: class HelloWorld
[javac] public void service(HttpServletRequest request,
[javac] ^
[javac] /home/asarkar/Development/anttest/example2/src/HelloWorld.java:18: cannot resolve symbol
[javac] symbol : class HttpServletResponse
[javac] location: class HelloWorld
[javac] HttpServletResponse response)
[javac] ^
[javac] /home/asarkar/Development/anttest/example2/src/HelloWorld.java:19: cannot resolve symbol
[javac] symbol : class ServletException
[javac] location: class HelloWorld
[javac] throws IOException, ServletException
[javac] ^
[javac] 6 errors
I have fixed it, javax.servlet.jar was not in the classpath, I have put and it compiles fine.
Regards