Why is javac failing on @Override annotation
        Posted  
        
            by skiphoppy
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by skiphoppy
        
        
        
        Published on 2010-02-25T16:30:59Z
        Indexed on 
            2010/03/29
            16:23 UTC
        
        
        Read the original article
        Hit count: 391
        
java
|annotations
Eclipse is adding @Override annotations when I implement methods of an interface. Eclipse seems to have no problem with this. And our automated build process from Cruise Control seems to have no problem with this. But when I build from the command-line, with ant running javac, I get this error:
[javac] C:\path\project\src\com\us\MyClass.java:70: method does not override a method from its superclass
[javac]     @Override
[javac]      ^
[javac] 1 error
Eclipse is running under Java 1.6. Cruise Control is running Java 1.5. My ant build fails regardless of which version of Java I use.
© Stack Overflow or respective owner