zoukankan      html  css  js  c++  java
  • 新建maven指定jdk版本-eclipse新建maven项目报错The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path的解决方案

    具体表现为:

    使用Eclipse+Maven建立了一个Javaweb工程,JSP页面顶端出现“红色”的报错信息:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path。

    解决方法:

    在pom.xml中的  <build></build>中  添加:

        <plugins>
            <!-- 编码和编译和JDK版本 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>utf8</encoding>
                </configuration>
            </plugin>
        </plugins>

     然后Maven > Update project即可

    如果报错:

    Java compiler level does not match the version of the installed Java project facet.    xxx        Unknown    Faceted Project Problem (Java Version Mismatch)

    可以:项目--properties---project Facets设置java文件的版本为 1.8(自己对应上面步骤的jdk)

  • 相关阅读:
    HTML5小游戏-绵羊快跑
    JavaScript模拟下拉菜单代码
    作业6
    作业5
    作业4
    作业三
    作业2(第二遍)
    sap jco3安装
    jmeter脚本文件(jmx)关联
    正则替换:删除空行、格式化Json/xml
  • 原文地址:https://www.cnblogs.com/007sx/p/5658978.html
Copyright © 2011-2022 走看看