Eclipse通过Maven插件创建webapp项目中遇到的问题
JSP Problem The super class “javax.servlet.http.HttpServlet” was not found on the Java Build Path
解决办法:
Properties – Java Build Path – Add Library – Server Runtime – Apache Tomcat vX.0Faceted Project Problem Java compiler level does not match the version of the installed Java project facets。
解决办法:
打开项目目录下面的 .settings/org.eclipse.wst.common.project.facet.core.xml<?xml version="1.0" encoding="UTF-8"?> <faceted-project> <fixed facet="wst.jsdt.web"/> <installed facet="java" version="1.5"/> <installed facet="jst.web" version="2.3"/> <installed facet="wst.jsdt.web" version="1.0"/> </faceted-project>
修改 java 和 jst.web 到指定的版本。
<installed facet="java" version="1.8"/> <installed facet="jst.web" version="3.0"/>
Dynamic Web Module 3.0 requires Java 1.6 or newer error while creating new project
解决办法:
在pom.xml 文件中指定编译时使用的java版本。<build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build>