@Override gives error in eclipse?

When I import a project from a workspace into eclipse, it gives an error when annotating @Override . If the project has any method that has annotation, it displays as an error, and when I delete it, it works fine, but when I have a large project with a lot of annotations, what should I fix it?

+3
source share
3 answers

You get an error because you are using Java 1.5, which does not support @Override annotations to override implementations. Go to Eclipse settings and set the language level to 1.6.

EDIT - to change the language level, go to Project> Properties> Java Compiler and set the language level there. You may need to click to enable specific project settings.

+14
source

You probably set your project level to a level below 1.5, where the @Override parameter was entered. Or you have it installed below 6, and the project code uses @Override for methods that implement interface methods that were introduced only in Java 6. Change the language level of the project.

+5
source

@Override not Android specific, but a java annotation. If you get errors, you may have selected Java 1.5 in the eclipse / project settings. Change it to Java 1.6 or higher and it should disappear.

+1
source

Source: https://habr.com/ru/post/917309/


All Articles