project的java level 已经核实确实为8,但是IDEA里面仍然会有如下图的提示:

通过查看项目设置,发现project的java level 也是8。

然后继续检查其他模块 如modules ,发现了问题所在。

改为8就好了。
遇到类似问题重点排查的位置:
project structure中的project,module中的sources和setting中的java compiler
博客介绍了在IDEA中,尽管已设置JDK为1.8,但仍然出现'Diamond types are not supported at this language level'警告的情况。作者通过检查project和module的设置,发现并解决了问题,建议遇到相同问题的开发者着重排查project structure的project、module的sources及settings中的java compiler设置。
project的java level 已经核实确实为8,但是IDEA里面仍然会有如下图的提示:

通过查看项目设置,发现project的java level 也是8。

然后继续检查其他模块 如modules ,发现了问题所在。

改为8就好了。
遇到类似问题重点排查的位置:
project structure中的project,module中的sources和setting中的java compiler

被折叠的 条评论
为什么被折叠?