Eclipse惊现The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path解决方法

Eclipse惊现The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path解决方法_第1张图片
原因tomcat设置问题
1、下载tomcat官网
Eclipse惊现The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path解决方法_第2张图片2、解压缩,放到指定文件夹(防止误删)
3、Windows->Preferences->Runtime Environments->Add->Apache->Apache tomcat 指定版本->Next->第2步tomcat的位置->finish->Apply and close
Eclipse惊现The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path解决方法_第3张图片
Eclipse惊现The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path解决方法_第4张图片
Eclipse惊现The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path解决方法_第5张图片
Eclipse惊现The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path解决方法_第6张图片
Eclipse惊现The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path解决方法_第7张图片

3、选中项目名,右键Build Path->Configure Build Path->Add Library…->Server Runtime->第3步的代名->finish->apply and close,问题解决
Eclipse惊现The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path解决方法_第8张图片
Eclipse惊现The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path解决方法_第9张图片
Eclipse惊现The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path解决方法_第10张图片
Eclipse惊现The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path解决方法_第11张图片
Eclipse惊现The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path解决方法_第12张图片

你可能感兴趣的:(javaee,java,tomcat,eclipse,servlet,js)