Configure environment variables: add three system variables: 1. JAVA_HOME: C: \ JDK actual JDK Location 2. TOMCAT_HOME (or CATALINA_HOME): C: \ Tomcat 3. CLASSPATH: % JAVA_HOME % \ lib; % atat_home % \ lib 4, C: \ Program Files \ Java \ jdk1.6.0 _ 16 \ bin (in JDK bin), CLASSPATH is separated by semicolons, add it to the end. The environment variables of Tomcat are configured. Check whether Tomcat can run in the following way: Go to the C: \ Tomcat \ bin directory in the console, run startup, and a window is displayed, after a bunch of jumps, it indicates that the Server has been running in the browser and entered http: // localhost: 8080. When the welcome page appears, it indicates that Tomcat is okay and is the same as above, write your first Servlet import java. io. *; import javax. servlet. *; import javax. servlet. http. *; public class HelloWorld extends HttpServlet {public void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, iow.t Ion {response. setContentType ("text/html"); PrintWriter out = response. getWriter (); out. println ("