In Java5, @Override can not be use for implementation of an interface method. Its only valid for super/subclass overriding. In Java6, @Override can be used for that implementation of an interface method as well.
Eclipse uses the JDK for the project/workspace - Maven's compile plugin uses the configuration in the pom.xml for what level of conformity to use. Not sure if that helps but hope it points in the right direction... Brian ----- Original message ----- From: "Cristiano Gavião" <[email protected]> To: [email protected] Date: Sat, 29 Jan 2011 17:31:48 -0300 Subject: [jbehave-dev] weird compiler error on two classes at eclipse... Hi, I just have fetched a new version of Jbehave and I'm getting a compiler error at eclipse... maven's build is ok. I'm using a new eclipse helios 3.6.1 and maybe could be some about compiler defaults configuration on jdk 6 at eclipse... I don't remember to have change anything... On AbsolutePathCalculator.java and RelativePathCalculator.java, IDE is complaing about "@Override" statement: "The method calculate(String, String) of type AbsolutePathCalculator must override a superclass method AbsolutePathCalculator.java /jbehave-core/src/main/java/org/jbehave/core/io line 8 Java Problem" "The method calculate(String, String) of type RelativePathCalculator must override a superclass method RelativePathCalculator.java /jbehave-core/src/main/java/org/jbehave/core/io line 15 Java Problem" public class AbsolutePathCalculator implements PathCalculator { @Override public String calculate(String root, String path) { return path; } } it works ok after have removed the statement... Should we use Override just when we extend some class from now? and why maven build don't give me anything? :-s did somebody already saw something like that? regards Cristiano --- Brian Repko LearnThinkCode, Inc. http://www.learnthinkcode.com email: [email protected] phone: +1 612 229 6779
