简体   繁体   中英

Compiler error with @override when overriding an interface method on JDK 7u2

I know, this sounds like an old question, which has been asked before( * ). But it is a little bit different. I installed a clean system with the newest versions of JDK (7u2) and eclipse (and also AndroidSDK). When I import old projects, I get an error "The method methodName(Parameter) of type Class must override a superclass method".

The @override-tag was there (correctly), because the method overrides a method of an INTERFACE of the superclass. somehow compiler thinks that this tag is just for superclass directly. As far as i know @override is not changed in Java 7 and my project was working properly on 6. Is it a possible bug or compability problem or I am missing something?

( * )Similar problem used to happen, when compiling on JDK5, simply because @override was yet implemented in Java 5. Solution was, of course changing compiler compliance level to 6. But what is it with JDK 7 now?

You shouldn't use JDK 7 for the development. There is a requirement that you have to use JDK 5 or 6.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM