Community
Participate
Working Groups
Build Identifier: 20100218-1602 I am currently using the JDT compiler with Ant. Inside Eclipse I get no errors. However, once I run the ant build I get errors that methods with the @Override annotation do not override a method in the interface. If I switch to the native compiler it works fine. If I remove the @Override annotation it works fine. Reproducible: Always Steps to Reproduce: Whenever I use ant with JDT as my compiler and I have an implementation or subclass in which I use the @Override annotation.
@Override for interface methods is a Java 6 thing. You need to ensure you have the correct settings in your Eclipse project and your Ant file (they should match, naturally).
In particular: where the javac compiler always assumes it is targeted at its "own" version of java (that is, javac 1.6 targets Java 1.6 behavior by default), you have to explicitly target the Eclipse command-line compiler. I think the options are -target and -compliance, but I might be misremembering.
I will give that a try. I believe the ant property is javac.target=1.6
I would need an ant script that reproduces the problem.
I modified the original build file to specify a javac target as 1.6 and it works. Thanks for your help.
Closing, not a bug.
Verified for 3.6M7.