在网上下载的开源工程,用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. 关于使用JPA中@Query注解传递表名/视图名参数的问题

    因碰到需要动态查询不同视图的结果,自己尝试使用@Query注解中传递视图名称参数: @Query("select * from ?1") List<Object> ge ...

  2. 学c++需要先学c语言吗?

    看你的需求,如果是底层开发,就必须学习C语言.如果只是应用开发,可以直接从C++开始学习.实际上这两个语言是平等的,只是在语法上C++尽量与C兼容,但仍然有很多不同的地方. 1) C++不是C的超集. ...

  3. spring(三、spring中的eheche缓存、redis使用)

    spring(三.spring中的eheche缓存.redis使用) 本文主要介绍为什么要构建ehcache+redis两级缓存?以及在实战中如何实现?思考如何配置缓存策略更合适?这样的方案可能遗留什 ...

  4. CSS3 transform变形(3D转换)

    一.三维坐标 空间中三维坐标如下图所示: 向上为-Y,向下为+Y,向左为-X,向右为+X,向前为+Z,向后为-Z. 二.perspective(n)为 3D 转换元素定义透视视图 perspectiv ...

  5. CCF-Markdown-201703-3

    这道题不存在递归结构 比如区块之间的相互嵌套 还有"[ [] ]" 链接的相互嵌套, 所以直接处理就好了 还可以 #include <bits/stdc++.h> us ...

  6. IO流小笔记

    File file=new File ();括号里面写路径 exists()判断文件是否存在:isfile()是判断已经存在的文件是文件还是目录: mkdir()和createNewFile()区别在 ...

  7. websocket 11

    1. websocket 回顾: - 什么是轮训? - 通过定时器让程序每隔n秒执行一次操作. - 什么是长轮训? - 浏览器向后端发起请求,后端会将请求 hang 住,最多hang 30s. 如果一 ...

  8. 十三、springboot (八)Admin

    1.创建server端spring-boot-admin 2.添加依赖 <parent> <groupId>org.springframework.boot</group ...

  9. Excel--按内容分页打印

    当我们有这样一张表,需要按不同城市分页打印,每页带标题行,可按以下步骤:1.点击城市一列任一单元格,点击“开始”——>“排序和筛选”(升序): 2.点击“数据”-->“分类汇总”: 分类字 ...

  10. android 使用Retrofit2 RxJava 文件上传

    private static void upload(final Context context, final int type, File logFile) { Map<String, Req ...