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


    异常消失了


  • 相关阅读:
    关于Android反编译
    调用图灵机器人API实现Android智能机器人
    STM32 驱动1602液晶
    1602A液晶
    STM32 PWM波
    STM32的优先级NVIC_PriorityGroupConfig
    STM32——timer
    Ajax Json的后台例子
    固定导航例子
    本周学习总结
  • 原文地址:https://www.cnblogs.com/evan-liang/p/9189631.html
Copyright © 2011-2022 走看看