解决IntelliJ IDEA 报编译错误Error:(36, 74) java: diamond operator is not supported in -source 1.5 (use -s

来源:互联网 发布:移动巡检软件 编辑:程序博客网 时间:2024/06/13 16:20

用IntelliJ IDEA创建maven项目,当运行时如果没有进行language level设置可能会报如下错误(如果你的JDK版本高于1.5):

Error:(36, 74) java: diamond operator is not supported in -source 1.5
  (use -source 7 or higher to enable diamond operator)

解决方法:

File -> Project Structure -> Project Settings -> Modules -> "Your Module Name" -> Sources -> Language Level(将这个Language Level设置成与你的JDK版本相同的版本即可)

0 0
原创粉丝点击