Eclipse chokes on enum, even though Compiler compliance level is 1.6

Nicolas Raoul picture Nicolas Raoul · Dec 22, 2011 · Viewed 13.4k times · Source

I have set my Eclipse project's Compiler compliance level to 1.6

But I get errors like in the screenshot below: Syntax error, annotations are only available if source level is 1.5.

I have refreshed/cleaned/restarted Eclipse at least 10 times.
It compiles fine with Maven2. The Eclipse project has been generated by Maven2.
The project uses java-6-openjdk

enter image description here

Answer

Other solution:

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.