在网上下载的开源工程,用maven构建的时候报错:

Dynamic Web Module 3.0 requires Java 1.6 or newer.

JAX-RS (REST Web Services) 2.0 requires Java 1.6 or newer.

即使你把properties->Java Compiler->Complier compliance level设置为1.7或1.8也不管用。

解决方法:

第一步,在pom.xml中定义jdk的版本,如下

     <build>
<finalName>Example</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-complier-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
   </build>

以及

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
</properties>

  

第二步,修改.settings文件夹里的org.eclipse.jdt.core.prefs文件,把其中的版本均改为1.7

org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.source=1.7

第三步,修改.settings文件夹里的org.eclipse.wst.common.project.facet.core.xml,把其中java的版本改为1.7

<installed facet="java" version="1.7"/>

完成之后,再通过maven的update project操作,刷新整个工程。

[maven] "Dynamic Web Module 3.0 requires Java 1.6 or newer." OR "JAX-RS (REST Web Services) 2.0 requires Java 1.6 or newer."的更多相关文章

  1. Solving “Dynamic Web Module 3.0 requires Java 1.6 or newer” in Maven Projects

    不一定是在Maven Projects里才有这种情况,但解决方法是一样的. 转自:http://qussay.com/2013/09/13/solving-dynamic-web-module-3-0 ...

  2. MAVEN ERROR : Dynamic Web Module 3.0 requires Java 1.6 or newer

    问题: 在eclipse中,通过Maven->Update Project更新项目后,出现Dynamic Web Module 3.0 requires Java 1.6 or newer错误提 ...

  3. Maven 编译错误 Dynamic Web Module 3.0 requires Java 1.6 or newer 解决方案

    Eclipse Maven 开发一个 jee 项目时,编译时遇到以下错误:Description Resource Path Location TypeDynamic Web Module 3.0 r ...

  4. maven项目中的报错问题——Dynamic Web Module 3.0 requires Java 1.6 or newer.

    转自:http://www.cnblogs.com/beppezhang/p/5919221.html maven项目中的报错问题——Dynamic Web Module 3.0 requires J ...

  5. maven Dynamic Web Module 3.0 requires Java 1.6 or newer

      maven Dynamic Web Module 3.0 requires Java 1.6 or newer CreateTime--2018年4月19日16:56:42 Author:Mary ...

  6. Eclipse Maven 编译错误 Dynamic Web Module 3.0 requires Java 1.6 or newer 解决方案

    Eclipse Maven 开发一个 jee 项目时,编译时遇到以下错误:Description Resource Path Location TypeDynamic Web Module 3.0 r ...

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

  8. Cannot change version of project facet Dynamic Web Module to 3.0 requires Java 1.6 or newer 解决方案

    Eclipse Maven 开发一个 jee 项目时,编译时遇到以下错误:Description Resource Path Location TypeDynamic Web Module 3.0 r ...

  9. (转) Eclipse Maven 编译错误 Dynamic Web Module 3.1 requires Java 1.7 or newer 解决方案

    场景:在导入Maven项目时候遇到如下错误. 1 问题描述及解决 Eclipse Maven 开发一个 jee 项目时,编译时遇到以下错误:Description Resource Path Loca ...

随机推荐

  1. L2-007. 家庭房产(并查集)*

    L2-007. 家庭房产 参考博客 #include <iostream> #include <cstdio> #include <cstring> #includ ...

  2. jquery中filter的用法

    一.filter的参数类型可分为两种 1.传递选择器 $('a').filter('.external') 2.传递过滤函数 $('a').filter(function(index) {       ...

  3. python select解析 socket高效通信服务器 自己写的socketserver

    import select import socket import queue server = socket.socket()#创建服务器端 server.bind(('localhost',99 ...

  4. robot framework中的timeout的关键词

    1.默认robotframework中的含有等待的关键词(如:Wait Until Element Is Enabled),未手动设置时默认该参数为5sec 2.关键词:sleep A)一般在调试的时 ...

  5. Go Example--排序

    package main import ( "fmt" "sort" ) func main() { strs := []string{"c" ...

  6. java android 捕获未处理异常

    1. 定义一个异常处理类 public class ExceptionHandler implements Thread.UncaughtExceptionHandler { public Excep ...

  7. delphi XML简单处理

    unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System ...

  8. golang 写日志到syslog

    应用程序可以通过 UNIX domain sockets, UDP or TCP,向syslog守护进程发送日志.syslog守护进程可以在远端. 这样,就可以不用单独收集应用程序的日志了. gola ...

  9. 单因素方差分析的SAS实现

    实验内容:某城市从4个排污口取水,进行某种处理后检测大肠杆菌数量,单位面积内菌落数如下表所示,请分析各个排污口的大肠杆菌数量是否有差别. 排污口 1 2 3 4 大肠杆菌数量 9,12,7,5 20, ...

  10. Xilinx 7 series FPGA multiboot技术的使用

    Xilinx 7 series FPGA multiboot技术的使用 当升级程序有错误的时候,系统会启动golden bitstream 注意:需要在源工程与升级工程中添加如下约束语句 生成组合mc ...