Android: rebuild now requires a compiler compliance level of 5.0 or 6.0. Instead, "1.7" was found. Why remove @Override?

Possible duplicate:
Android requires a compiler compliance level of 5.0 or 6.0. Instead, "1.7" was found. Use Android Tools> Fix Project Properties

After recovering my PC, I get this error when importing my projects.

Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties. 

I saw that this was raised on SO, and I can fix my projects by running Fix Proj and then deleting all my @OVerrides.

This question, why do I need to remove @Overrides now? and will that change my designs anyway?

greetings

Edit to add walkthrough information.

I import the project, I get the error above. Then I do Android Tools > Fix Project Properties . This now sets Project> Properties Java Compile to Compiler Compliance Level 1.5

After that, I remain with a number of errors in my java files. on this particular project my errors are on

 @Override public void run() {... 

Token error to the left of the error ...

 Multiple markers at this line - The method run() of type new Runnable(){} must override a superclass method - implements java.lang.Runnable.run 

The hover error in eclipse suggests that I remove @Override to fix this problem, and if I remove @Override, it will fix the problem and my project will now compile and run. This is not true?

ps I just wrote all this, changed the Java compliance level to 1.6 and all the override errors disappeared! Can someone explain (and I fully understand that this may be completely off topic) why?

+6
source share
2 answers

Do not remove the @overide notation.

You must establish the compatibility of the project with Java 5.0 or Java 6.0.

There are 2 options for this:

1) right-click on your project and select "Android Tools -> Fix Project Properties" (if this does not work, try the second option)

2) right-click the project and select "Properties -> Java Compiler" , check "Enable special project settings" and select 1.5 or 1.6 from the "Compiler Compliance Settings" . box.

send this link for reference

+13
source

FIRST UPDATE TOTAL ....

Now right-click on your project and select “Android Tools”, then “Add Support Library”, which will be updated, then try the content that I copied from above ....

1) right-click on your project and select "Android Tools → Fix Project Properties" (if this does not work, try the second option)

2) right-click on your project and select "Properties → Java Compiler", select the "Enable special project settings" checkbox and select "1.5 or 1.6" in the "Compiler Compliance Settings" field.

Many thanks to Agarwal Shankar for starting ...

+1
source

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


All Articles