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