Remove @Override annotration解决
y Michael Myers♦ Nov 19 '10 at 15:17
This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned more than 10 reputation on this site.
275
|
Eclipse is defaulting to Java 1.5 and you have classes implementing interface methods (which in Java 1.6 can be annotated with @Override, but in Java 1.5 can only be applied to methods overriding a superclass method). Go to your project/ide preferences and set the java compiler level to 1.6 and also make sure you select JRE 1.6 to execute your program from eclipse. |
||||||||||||
feedback
|
65
|
With Eclipse Galileo you go to Eclipse -> Preferences menu item, then select Java and Compiler in the dialog. Now it still may show compiler compliance level at 1.6, yet you still see this problem. So now select the link "Configure Project Specific Settings..." and in there you'll see the project is set to 1.5, now change this to 1.6. You'll need to do this for all affected projects. This byzantine menu / dialog interface is typical of Eclipse's poor UI design. |
||||||||||
feedback
|
5
|
In case this happens to anyone else who tried both alphazero and Paul's method and still didn't work. For me, eclipse somehow 'cached' the compile errors even after doing a Project > Clean... I had to uncheck Project > Build Automatically, do a clean and build again. |