I try to use the following code:
ArrayList
Map
Eclipse complains about both of them: Syntax Error, para
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.
It can be resolved as follows:
Go to Project properties.
Then 'Java Compiler' -> Check the box ('Enable project specific settings')
Change the compiler compliance level to '5.0' & click ok.
Do rebuild. It will be resolved.
Also, click the checkbox for "Use default compliance settings".
Right click your project and choose properties in the properties dialog check the Java Compiler settings, maybe you have different workspace settings.
Do the following..
Right-click on your project--> select properties-----> select Java Compilers
You wills see this window
Image for reference
Now check the checkbox ---> enable project specific settings.
Now set the compiler compliance level to 1.6
Apply then Ok
now clean your project and you are good to go
This workaround is helpful when this problem pops up.
1) Set Workspace JRE to 1.5 (and apply/save). Projects will rebuild.
2)Set Workspace JRE back to 1.6 (and apply/save). Projects will rebuild.
All errors are then gone (for now at least).
Go to Project properties.
Then 'Java Compiler' -> Check the box and "Enable project specific settings"
Uncheck the box to "Use Compliance from execution environment 'OSGi/Minimum-1.2' on the Java"
Then change the compiler compliance level to '1.5' and click Ok.
Rebuild it and your problem will be resolved.