Idea中JDK为1.8,还提示Diamond types are not supported at this language level

help------about查看ide的版本:

IntelliJ IDEA 2017.3.7 (Ultimate Edition)
Build #IU-173.4710.11, built on April 4, 2019
Licensed to Rover12421 / Rover12421
You have a perpetual fallback license for this version
Subscription is active until December 31, 2099
JRE: 1.8.0_152-release-1024-b18 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 7 6.1

新建的一个maven项目,一路点next创建的,结果 new KafkaProducer<>的时候报错:

Diamond types are not supported at this language level

 

 可以看到Diamond 是JDK1.7的特性,所以1.5肯定是不支持的。

 

右键项目,选择Open Module Setting

 

打开如下的弹窗,报错就是这里的Language level默认还是5.0

 

posted on 2019-07-14 11:02  坚守梦想  阅读(1452)  评论(0编辑  收藏  举报