Eclipse: Syntax Error, parameterized types are only if source level is 1.5

后端 未结 17 1820
清酒与你
清酒与你 2020-12-13 01:55

I try to use the following code:

ArrayList
Map

Eclipse complains about both of them: Syntax Error, para

17条回答
  •  一生所求
    2020-12-13 02:20

    I'm currently working with Eclipse Luna. And had the same problem. You might want to verify the compiler compliance settings, go to "Project/Properties/Java Compiler"

    The Compiler compliance level was set to 1.4, I set mine to 1.5,(and I'm working with the JDK 1.8); it worked for me.

    And if you had to change the setting; it might be useful to go to "Window/Preferences/Java/Compiler" And check to see that the Compiler compliance level is 1.5 or higher. Just in case you have a need to do another Java project.

提交回复
热议问题