编译报错:-source 1.5 中不支持 diamond 运算符

此报错是因为java1.5版本不支持,需要改成1.8

首先检查idea的 File--Project Structure


然后检查File-Settings
修改Compiler--Java Compiler中的版本

最后在pom.xml中添加下面的配置,然后重新编译即可


        
            
            org.apache.maven.plugins
            maven-compiler-plugin
            3.6.1
            
                1.8
                1.8
            
            
        
    

你可能感兴趣的:(编译报错:-source 1.5 中不支持 diamond 运算符)