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肯定是不支持的。

Idea中JDK为1.8,还提示Diamond types are not supported at this language level_第1张图片

 

右键项目,选择Open Module Setting

Idea中JDK为1.8,还提示Diamond types are not supported at this language level_第2张图片

 

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

Idea中JDK为1.8,还提示Diamond types are not supported at this language level_第3张图片

 

转载于:https://www.cnblogs.com/mkl34367803/p/11183438.html

你可能感兴趣的:(Idea中JDK为1.8,还提示Diamond types are not supported at this language level)