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

    问题

    我目前用的JDK 是java 1.8 ,搭建Maven项目的时候,设置Project facets后,出现来以下problem : Dynamic Web Module 3.0 requires Java 1.6 or newer. 


    然后尝试如下方案依然没有效果:

    1. Go to project Build Path and change the Java Library version to 1.7
    2. Go to Eclipse Preferences -> Java -> Compilre -> Change compliance level to 1.7 

    3. Right click on project -> Properties -> Project Facets
    4. Uncheck Dynamic Web Module and click Apply (also uncheck JavaServer Faces if you had that)
    5. Change the Java facet version to 1.8 and click Apply
    6. Add the Dyanmic Web Module v3.0, apply.

    解决方案

    经过反复试验,可以通过以下途径解决:
    1.打开pom.xml
    2.加入以下插件
     <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
             <source>1.8</source> 
             <target>1.8</target> 
        </configuration>
    </plugin>
    3.右键点击项目->Maven->Update Project


    异常消失了


  • 相关阅读:
    接口
    多态
    static的用法
    Person类中多个构造方法和测试
    曹操外卖实现功能
    曹操外卖数据表设计
    java中 try catch finally和return联合使用时,代码执行顺序的小细节
    GenerationType四中类型
    spring boot
    VMware修改为静态ip
  • 原文地址:https://www.cnblogs.com/evan-liang/p/9189631.html
Copyright © 2011-2022 走看看