openjdk 1.7 in eclipse: operator is not allowed for source level below 1.7

后端 未结 8 1227
无人共我
无人共我 2020-12-14 14:17

Eclipse gives me an error:

\'<>\' operator is not allowed for source level below 1.7 

I guess this is because it is not using java 1

相关标签:
8条回答
  • 2020-12-14 14:50

    Right-click on the project. Choose Properties. Choose Java Compiler on the left. Choose 1.7 for the Compiler Compliance level. If the 2 drop-downs below that aren't 1.7, uncheck Use default compliance settings and set those to 1.7.

    0 讨论(0)
  • 2020-12-14 14:54

    If you want to use below version, use

    Map<String, Integer> map = new HashMap<String, Integer>();
    

    instead of

    HashMap<String, Integer> map = new HashMap<>();
    
    0 讨论(0)
提交回复
热议问题