Avinash Sridhar <mailto:[EMAIL PROTECTED]> wrote: > hi all, > I am having trouble in compiling the HelloServlet.java file,When > I type in javac HelloServlet.java file,I get the following errors > > /**************Errors while compiling**********************/ > > HelloServlet.java:2: package javax.servlet does not exist > import javax.servlet.*; > ^ > HelloServlet.java:3: package javax.servlet.http does not exi > import javax.servlet.http.*; > ^ > HelloServlet.java:13: cannot resolve symbol > symbol : class HttpServlet > location: class HelloServlet > public class HelloServlet extends HttpServlet { > ^ > HelloServlet.java:14: cannot resolve symbol > symbol : class HttpServletRequest > location: class HelloServlet > public void doGet(HttpServletRequest request, > ^ > HelloServlet.java:15: cannot resolve symbol > symbol : class HttpServletResponse > location: class HelloServlet > HttpServletResponse response) > ^ > HelloServlet.java:16: cannot resolve symbol > symbol : class ServletException > location: class HelloServlet > throws ServletException, IOException { > ^ > 6 errors > > /**************Errors while compiling**********************/ > > > I have written a batch file tomcat..bat like this > > /********** tomcat.bat *************/ > > set classpath=;E/tomcat/tomcat-5/common/lib/servlet-api.jar > set classpath=;E/tomcat/tomcat-5/common/lib/jsp-api.jar > > /********** tomcat.bat *************/
You need both JARs in the classpath. Try: set CLASSPATH=E:\tomcat\tomcat-5\common\lib\servlet-api.jar;E:\tomcat\tomcat -5\common\lib\jsp-api.jar javac -classpath .;%CLASSPATH% *.java > The tomcat.bat file is in the same folder as the source file > HelloServlet.java. > > Kindly let me know. > > Help would be appreciated > > Thanks > AS Regards, Marcel --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
