错误定位

当时并没有弄明白为什么会出错,一脸懵逼相

解决办法:

将source compatibility和target compatibility都改为1.7,重新build就ok了。

错误原因:

官方解释

You can replace the type arguments required to invoke the constructor of a generic class with an empty set of type parameters (<>) as long as the compiler can infer the type arguments from the context. This pair of angle brackets is informally called the diamond.

For example, consider the following variable declaration:

Map<String, List<String>> myMap = new HashMap<String, List<String>>();

In Java SE 7, you can substitute the parameterized type of the constructor with an empty set of type parameters (<>):

Map<String, List<String>> myMap = new HashMap<>();

运行开源项目,报错Error:(48, 37) 错误: -source 1.6 中不支持 diamond 运算符,请使用-source 7或者更高版本已启用diamond运算符的更多相关文章

  1. Intellij IDEA新导入项目运行出现Error:(60, 47) java: -source 1.5 中不支持 diamond 运算符 (请使用 -source 7 或更高版本以启用 diamond 运算符)

    后台窗口报错如下: 问题原因 项目jdk版本配置不正确. 解决方案 ①File ->Project Structure ② ③之后还要检查一下这里 Settings-->Build,Exe ...

  2. springboot 使用maven 打包 报 (请使用 -source 7 或更高版本以启用 diamond 运算符) 错误解决办法

    在使用springboot maven 打包时 报如下错误 (请使用 -source 7 或更高版本以启用 diamond 运算符) pom.xml编译插件 配置如下: <plugin> ...

  3. 运行springboot项目报错 Error running 'ResourceApplication': Command line is too long. Shorten comma

    方法1 IDEA 运行报错:Error running '***': Command line is too long 技术标签: IDEA     Error running 'Test': Com ...

  4. Error:(18, 51) java: -source 1.5 中不支持 diamond 运算符 (请使用 -source 7 或更高版本以启用 diamond 运算符)

    问题:主要是因为jdk版本不一样 解决: 方法一:List<String> list=new ArrayList<Stirng>(); 方法二:重新安装jdk8的版本(安装和配 ...

  5. Error:(18, 51) java: -source 1.5 中不支持 diamond 运算符 (请使用 -source 7 或更高版本以启用 diamond 运算符)

    问题:主要是因为jdk版本不一样 解决: 方法一:List<String> list=new ArrayList<Stirng>(); 方法二:重新安装jdk8的版本(安装和配 ...

  6. Error:(4, 13) java: -source 1.5 中不支持默认方法 (请使用 -source 8 或更高版本以启用默认方法)

  7. 运行springboot项目报错:Field userMapper in XX required a bean of type 'xx' that could not be found.

    运行springboot项目报错: *************************** APPLICATION FAILED TO START ************************** ...

  8. 深度强化学习 之 运行环境 mujoco 报错 ERROR: GLEW initalization error: Missing GL version

    使用  mujoco环境  运行代码,报错 ERROR: GLEW initalization error: Missing GL version 一直无法解决,发现网址: https://blog. ...

  9. idea使用"svn"到项目报错Error:Cannot run program "svn" (in directory "E:\XXXXXX"):CreateProcess error=2,

    使用新项目工具idea界面上导入svn项目报错: Error:Cannot run program "svn" (in directory "D:\XXXXXX" ...

随机推荐

  1. Android学习起步 - 新建工程及相关

    新手起步迷迷糊糊,以下记录迷惑之处,大家共勉!!! 1.创建安卓应用工程 选择Andriod Application Project 点下一步直到完成. 二.下面是新建工程注意的地方 (1)首选删除系 ...

  2. Chrome和Firefox浏览器执行new Date() 函数传参数得到不同结果的陷阱

    某日,同事问到关于new Date() 函数传参数,在火狐浏览器和谷歌浏览器控制台运行,会得到不同的结果,刚开始觉得不可能,后来实际操作才发现此陷阱 var date = new Date('2014 ...

  3. QTP安装连接Oracle数据库

    之前学过一段时间QTP,之后便没用这个笨重的东东,为了以防忘记,再次记录下曾经连接数据库经历了几天才搞好的事情(虽然这个工具可能已经过时,但是国企一般都会使用的) 前提条件: 你已经安装好了QTP / ...

  4. jQuery Validate + Ckeditor 驗證 textarea 解決方式

    jQuery Validate + Ckeditor 驗證 textarea 解決方式 html <textarea name="content" id="cont ...

  5. 2016-09-19: linux后台运行

    linux后台运行命令两种方式: 1. command & : 后台运行,你关掉终端会停止运行   2. nohup command & : 后台运行,你关掉终端也会继续运行 简介 L ...

  6. cs11_adventure c++_lab1

    exercise1.cc #include <iostream> #include <vector> #include <stdlib.h> #include &l ...

  7. background-size拉伸背景图片

    在制作页面中常需要对背景图片在容器中进行平铺,可用background-size属性对背景编辑:拉伸,压缩等~ background-size:contain; 将背景扩展到整个容器大小. 较为实用的 ...

  8. jq封装的tab切换

    function tab(a,b,c){ $(a).on(c,function(){ $(this).addClass('active').siblings().removeClass('active ...

  9. 使用SerialPort 读取外置GPS信息和使用GeoCoordinateWatcher获取内置gps的信息

    简介最近工作中需要读取gps设备的信息,平板本身有内置的gps设备,但是精度不够,就又添加了一个外置的gps.对于外置的gps,我们主要通过SerialPort类来获得串口的信息,然后对接收到的内容进 ...

  10. log4net 记录日志到sqlserver

    参考:http://blog.csdn.net/niuyongjie/article/details/5777625 demo