在idea ide中获得菱形运算符的编译错误 [英] getting compile error for diamond operator in idea ide

查看:14
本文介绍了在idea ide中获得菱形运算符的编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在idea ide中编译一些简单的源代码时遇到此错误.

I am getting this error while trying to compile some simple source code in idea ide.

java: diamond operator is not supported in -source 1.6 (use -source 7 or higher to enable diamond operator)

jdk 是来自 oracle 的 1.7.40

jdk is 1.7.40 from oracle

但是这个地方在哪里添加这个-source 7"选项?

but where is this place to add this "-source 7" option?

我尝试添加 ide 设置,但没有效果.

i tried adding in ide settings but that had no effect.

推荐答案

您需要设置项目语言级别(所有模块默认)模块语言级别

You need to set the project language level (default for all modules) and the module(s) language level

这篇关于在idea ide中获得菱形运算符的编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆