getting compile error for diamond operator in idea ide

后端 未结 4 1072
既然无缘
既然无缘 2020-11-30 13:57

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         


        
相关标签:
4条回答
  • 2020-11-30 14:07

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

    Project language level Module language level

    0 讨论(0)
  • 2020-11-30 14:07

    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
    
    0 讨论(0)
  • 2020-11-30 14:11

    Check Project Structure tab in IDEA, find the followng navigational path

    Project Structure -> Project -> Project SDK

    enter image description here

    0 讨论(0)
  • 2020-11-30 14:22

    Make sure that, in the Project Structure page, you have set your project language level to 7.0.

    enter image description here

    After you select this, you will have to reopen your project, but then your diamond operators should compile.

    0 讨论(0)
提交回复
热议问题