目录
出现的两个问题:
在我没进行任何修改之前出现的问题,在jsp页面上的报错:
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
我在类路径下添加了tomcat之后,在jsp页面上的报错:
Multiple annotations found at this line: - The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path - Line breakpoint:success.jsp [line: 1]
原因:
这是因为没有添加tomcat和没有配置jre环境的问题
解决方法:
解决类路径下没有tomcat的问题
- 工具栏点Windows - preferences
- Server - Runtime Environment - Add
- 输入tomcat,找到自己安装的tomcat版本
- 选择tomcat所在的文件夹
- 右键项目,点击properties,按图片进行点击
- 选择server runtime
- 点击你的tomcat
解决配置jre环境的问题
在添加Tomcat后仍报错是因为没有配置jre环境
报错为:
Multiple annotations found at this line:
- The superclass “javax.servlet.http.HttpServlet” was not found on the Java
Build Path
- Line breakpoint:success.jsp [line: 1]
- 右键项目,点击properties,按图片进行点击
- 按图片的样子选中