Servlets and JSP pages are not part of the Java 2 platform. You therefore need identify the servlet classes to the compiler. Here’s how:
Open the /root/.bash_profile file, and add the following lines:
This points the javac compiler to the servlet and JSP JAR files that are included in Tomcat 5.5.17. After this change, compilation of servlets and JSP’s should work without error.