@Override is not allowed when implementing interface method
If your project has multiple modules, also check that every module uses language level 6 or above, or use the project's language level (see Project Settings > Modules > xxx > Language level
).
You may need to reload your project once it is modified.
A simpler solution - inline
Put the caret on the
@Override
word and move the caret on the left side until the red bulb icon will appear. Then click on it.Click on Set language level to 6 - Override in interfaces
The method above is an alternative to the following approach:
Go to File > Project Structure... or press Ctrl+Alt+Shift+S
Go to Project Settings > Modules > Sources > Language level and choose any level that is 6 or greater than 6.
At your module/project, Right click to see context menu:
Choose Open Module Settings
or press F4. In setting windows:
Set value for Choose Language level
section.
You also should check Project language level
by this way: press Ctrl+Alt+Shift+S