javac -classpath F:\Tomcat\apache-tomcat-8.5.65\lib\servlet-api.jar HelloWorldServlet.java
要写-classpath,后面的路径根据Tomcat安装路径找对应的jar包,不然会报错: