[英]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.