I try to use the following code:
ArrayList
Map
Eclipse complains about both of them: Syntax Error, para
This works for me .
In eclipse go to project properties -> java compiler.
Then change to java higher than 1.5 .
change Compiler compliance settings to 1.6 change Generated.class files compatibility to 1.6 change Source compatibility to 1.6
Thanks.
My guess would be that while you run eclipse itself with JDK 1.6, it's actually configured with a different default jre.
See Window->preferences->java->Installed JREs
and make sure that the checked JRE is 1.6
.
If the default JRE is indeed 1.6, chances are that it's a project specific setting. See that the project is configured to use the right JRE.
I have experienced the same problem with Eclipse Indigo release - even though the project set up was correct. The main cause I suspect is that the workspace is defined in a separate folder from the actual source folders (as mentioned user748337). To fix the problem, I had to enable the project specific settings option (in the Porject preference) although it wasn't different from the workspace settings.
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
Select the checkbox for "Use default compliance settings"
I get this fairly regularily. Currently what's working for me (with Photon) is:
If this doesn't work :
I know, stupid isn't it.