I am getting compile errors in eclipse when using the @Override annotation for a class that is implementing an interface.
Compiler compliance level is set to Java 6.0.
I am using the latest version of the 6.0 jdk.
Error: "The method {methodname} of type {classname} must override a superclass method"
Same code works fine on mac with comparable configuration.
public interface ChannelIF {
...
public boolean canSendNarrowcast();
public boolean canSendBroadcast();
}
public class FacebookChannel implements ChannelIF
{
...
@Override
public boolean canSendNarrowcast() { return true; }
@Override
public boolean canSendBroadcast() { return true; }
}
This feature is only valid in Java 6 and higher. I see you are using jdk 1.6. That's good. Possible cause: You are compiling with -source 1.5
. Is this the case? If so, can you change it to -source 1.6
?
I too have facing problem and just resolved. Change "Compiler compliance level" to 1.6 in Project->right click->properties->Java compiler.
In eslipse can use different versions of compilers.
See сonfiguration in eclipse Preference->Java->Compiler "Compiler compliance level". You must choose "1.6".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With