zoukankan      html  css  js  c++  java
  • Dynamic Web Module 3.0 requires Java 1.6 or newer.

    查看 Java Build Path

    JRE System Libaray [J2SE-1.4]

    问题如上,解决方法是提高版本。

    问题引起原因:

    使用maven 时,pom.xml 指定的source 和 target 不存在时,则默认最低版本。

    现场:

    case1

    pom.xml

    <!-- build -->
        <build>
            <finalName>${project.artifactId}</finalName>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.2</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
    
         

    case2:

    > Java Build Path

    > JRE System Libaray [J2SE-1.4]

    case3:

    Java Compiler 1.7

    Java Installed JREs jdk1.7.x

    Apache Tomcat v7.0

    处理方案

    降低source 与 target

    or

    升级jdk

    备注:

    如需修改pom.xml 文件,则应 update maven project 。 坐等 Validating xxx:(0%)

    附:

    pom.xml 文件中的插件

    官方网站使用说明:http://maven.apache.org/plugins/maven-compiler-plugin/usage.html

    官方网站使用说明:http://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html

    For example, if you want to enable assertions (-source 1.4) and also want the compiled classes to be compatible with JVM 1.4 (-target 1.4), you can then put:

    <project>
      [...]
      <build>
        [...]
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.2</version>
            <configuration>
              <source>1.4</source>
              <target>1.4</target>
            </configuration>
          </plugin>
        </plugins>
        [...]
      </build>
      [...]
    </project>
  • 相关阅读:
    0523注册审核
    0520三级联动
    0519考试练习题
    0516ajax
    mysql 高级查询
    mysql
    HTML的格局与布局
    css样式表
    HTML表单
    HTML
  • 原文地址:https://www.cnblogs.com/zno2/p/4496474.html
Copyright © 2011-2022 走看看