I try to use the following code:
ArrayList<String>
Map<String, String>
Eclipse complains about both of them: Syntax Error, parameterized types are only if source level is 1.5.
I use JDK 1.6, but even if I go to compiler and switch the compliance to 1.5. It still give me this error. Any Idea why?
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.
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.
Single answer couldn't solve my problem so I used both :
.... tada...done... :)
change the compiler version to lower value and do apply the changes. The compilation will fail.
Now update the version to required and do apply the changes, the workspace will get rebuild and the issue will get resolved.
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.
I was able to solve this in Eclipse Helios by right-clicking on the project, picking "Java Build Path", "Add Library...", "JRE System Library", "Workspace default JRE (jdk1.6.0_17)" and finally "Finish".