Eclipse通过Maven插件创建webapp项目中遇到的问题

来源:互联网 发布:心理学本科网络教育 编辑:程序博客网 时间:2024/06/11 04:41

Eclipse通过Maven插件创建webapp项目中遇到的问题

  1. 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.0

  2. Faceted 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"/>
  3. 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>
0 0