I imported an Android project and it has a lot of @override method annotations, which Eclipse is complaining about (although the project has worked before and it should not be complaining). I'm using java sdk 1.7. Does anyone know anything about this? Thanks.
Asked
Active
Viewed 1,951 times
1
-
I usually have to do a clean on the project to get that to go away. – MikeC Feb 24 '12 at 22:38
-
Can you show us some examples of the 'problematic' code? – jbranchaud Feb 24 '12 at 22:40
1 Answers
4
Are the overrides on interface methods or superclass methods? Interface methods can only be marked with this annotation as of Java 6. What is the compiler compliance level set to for your project? What about for Eclipse in general? If it is not higher than 1.5, you will see such errors. Android officially supports compiler versions 1.5 and 1.6, last I checked.
(Also see the several related questions over there on the right for more details)

lyricsboy
- 2,999
- 24
- 21
-
They are superclass methods. My compiler settings for java are at 1.7. I tried changing to 1.6 but that didn't help either. How would I change the settings for Eclipse in general? – Tim Feb 24 '12 at 22:46
-
Preferences -> Java -> Compiler has the setting for Eclipse as a whole. If they are superclass methods, that is strange. Are they superclass methods that were added in a version of the Android SDK later than what you are building against, perhaps? – lyricsboy Feb 24 '12 at 22:53
-
@Tim, you may be using 1.7, but do you have the "compliance" setting at 1.4? You can make a 1.6-7 JDK compile to comply with an earlier JDK. You can check in project properties->Java Compiler->JDK Compliance. (Nothing else really makes sense) – Robin Feb 24 '12 at 23:16
-
I realized that I hadn't actually set the compiler compliance level for my projects -- only for Eclipse in general. My projects were in fact set to 1.5. When I tried to set it to 1.7 it wouldn't work, but setting it to 1.6 on all my problematic projects fixed the issue. Thanks everyone. – Tim Feb 24 '12 at 23:56