I am just biggining the preparation for scwcd and when i try to compile the following code it gives compiler error; please help me:
this code is from the book:Java the complete reference 5th edition page 953 and the error says:
package javax.servlet does not exist
package javax.servlet.http does not exist
cannot find symbol
cannot find symbol class ServletRequest
cannot find symbol class ServletResponse
cannot find symbol class ServletException
Swastik Dey wrote: Best thing is to use some ide(s) like netbeans,myeclipse etc.
No, it helps, but it's not the best thing to do. Because it means that you (I don't mean "you" of course) can't even compile a class file, so in my opinion, you are not qualified enough to pass SCWCD. Your suggestion about setting the servlet api library in the classpath is good. We have a FAQ about compiling servlets, here.
According to Swastik and Christophe, I set my CLASSPATH variable to: C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar
as the servlet-api is found at C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib in my computer.
Unfortunately it is not still compiling. the compiler which i am using is JCreator.
what else my be the problem or is there somethig wrong in setting my CLASSPATH?