Maven工程报Diamond types are not supported at language level '5’或Diamond types are not supported at this language level 的错误,只需要检查以下三个个地方即可:
以IDEA为例:
打开工程设置:
在这里插入图片描述
1.Project – Project language level:
在这里插入图片描述
2. Modules – Language level:
在这里插入图片描述
3.pom.xml
<build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build>
个人声明:此内容为引用他人并非原创(仅仅为了方便自己和他人)
引用出处:https://blog.csdn.net/dongzhensong/article/details/88799477