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?
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 JREsand make sure that the checked JRE is1.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.