@Override compile error, implementing an interface (eclipse jdk1.6.0_23 linux)

后端 未结 8 970
耶瑟儿~
耶瑟儿~ 2021-01-04 01:38

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.

相关标签:
8条回答
  • 2021-01-04 02:06

    I too have facing problem and just resolved. Change "Compiler compliance level" to 1.6 in Project->right click->properties->Java compiler.

    0 讨论(0)
  • 2021-01-04 02:13

    So, I kept having this problem, and after running through the above solutions a few times, seeing that my version of Java was set to 1.7 all the way down, not using Maven, and so just quitting and restarting Eclipse a couple times as @jdowdell suggested, after which, it would seem to work until the next time I implemented one of these. I realized that when I was re-starting Eclipse it was prompting me to save my files and I realized that my interfaces had not been saved, so the original method, the one being overrode, didn't exist on disk. And this is why quitting and restarting Eclipse fixes the problem.

    tl;dr : Check that all your files are saved.

    0 讨论(0)
提交回复
热议问题