简体   繁体   English

钻石算子在想法中得到编译错误

[英]getting compile error for diamond operator in idea ide

I am getting this error while trying to compile some simple source code in idea ide. 我在尝试在idea ide中编译一些简单的源代码时遇到此错误。

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

jdk is 1.7.40 from oracle oracle的jdk是1.7.40

but where is this place to add this "-source 7" option? 但是在何处添加“ -source 7”选项?

i tried adding in ide settings but that had no effect. 我尝试添加ide设置,但是没有效果。

You need to set the project language level (default for all modules) and the module(s) language level 您需要设置项目语言级别(所有模块的默认语言) 模块语言级别

项目语言水平模块语言水平

Make sure that, in the Project Structure page, you have set your project language level to 7.0. 确保在“项目结构”页面中将项目语言级别设置为7.0。

在此处输入图片说明

After you select this, you will have to reopen your project, but then your diamond operators should compile. 选择此选项后,您将必须重新打开项目,但随后您的钻石操作员应进行编译。

Check Project Structure tab in IDEA, find the followng navigational path 在IDEA中检查“项目结构”选项卡,找到以下导航路径

Project Structure -> Project -> Project SDK Project Structure -> Project -> Project SDK

在此处输入图片说明

Follow these steps. 跟着这些步骤。

Right Click on the project------>> go to Open module Settings--->
In that opening window click the Project in project settings---->
and set project SDK

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:-source1.5不支持菱形运算符 - error: diamond operator is not supported in -source1.5 Java7 Diamond运算符转换编译错误 - java7 diamond operator convert compilation error Java对象初始化与钻石运算符可怕的javac编译时性能 - Java object initialization with diamond operator terrible javac compile time performance Eclipse IDE编译错误 - Eclipse IDE compile error 由于具有私有访问权限而无法编译,并且仅在基于IntelliJ Idea的IDE中发生错误 - Cannot compile due has private access and error happens only in IntelliJ Idea based IDE 错误:(24,46)错误:-source 1.6不支持Diamond运算符(使用-source 7或更高版本来启用Diamond运算符) - Error:(24, 46) error: diamond operator is not supported in -source 1.6 (use -source 7 or higher to enable diamond operator) 使用IntelliJ IDEA IDE进行Selenium自动化处理IE9时遇到错误 - getting an error when opeming IE9 using IntelliJ IDEA IDE for Selenium automation Azure DevOps Pipeline 上的错误“-source 6 中不支持菱形运算符” - Error on Azure DevOps Pipeline "diamond operator is not supported in -source 6" 为什么我得到错误 diamond operator is not supported in -source 1.5 in Java? - Why i get error diamond operator is not supported in -source 1.5 in Java? Maven编译错误:(使用-source 7或更高版本启用菱形运算符) - Maven Compilation Error: (use -source 7 or higher to enable diamond operator)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM