晚上好! 我的问题很奇怪,但是我无法运行现有的maven项目。
IDE返回一个错误: 我有一堆。 我正在使用Intellij IDEA。 即使我只运行简单的mvn install,我也会遇到同样的问题。 我用谷歌搜索,但没有任何积极结果。
错误:(140,74)Java:-source 1.5不支持Diamond运算符 (使用-source 7或更高版本启用菱形运算符)
答案 0 :(得分:1)
IntelliJ要求您向pom.xml文件中添加一些属性
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
还要检查您选择的SDK:
和模块设置中的语言级别:
答案 1 :(得分:1)