use -source 7 or higher

后端 未结 7 1448
既然无缘
既然无缘 2020-12-28 12:15

While trying to build a project using intelliJ Ultimate 12 I am getting these errors

use -source or higher to enable diamond operator
use -source 7 or higher         


        
相关标签:
7条回答
  • 2020-12-28 13:15

    For me, it's because the maven-compiler-plugin's source and target is set to 1.6 rather than 1.7 in pom.xml, changing it to 1.7 solved the problem.

    <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.0</version>
        <configuration>
            <source>1.7</source>
            <target>1.7</target>
        </configuration>
    </plugin>
    
    0 讨论(0)
提交回复
热议问题