实现接口方法时不允许@Override [英] @Override is not allowed when implementing interface method

查看:1713
本文介绍了实现接口方法时不允许@Override的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有标题中提到的问题。你可以说这个线程重复另一个:如何在IntelliJ IDEA中关闭注释的错误验证?

I have the problem mentioned in the title. You could say that this thread duplicates another one: How do I turn off error validation for annotations in IntelliJ IDEA?

但是那里给出的解决方案不起作用。他们说我需要采取以下行动:

But the solution given there doesn't work. They say that I need to take the following action:


在项目结构中项目对话框,将项目语言级别更改为6.0 - 接口中的@Override。

In the Project Structure | Project dialog, change the Project language Level to 6.0 - @Override in interfaces.

但是,项目语言级别目前为6.0 ,但我仍然看到错误。

However, the Project language Level is 6.0 at the moment, but I still see the error.

Vic,这是窗口,语言级别下没有JVM版本(遗憾的是我无法发布图片,因为我有10个声誉)

Vic, here is the window and there is no JVM version right under Language level (unfortunately I can't post images because I have 10 reputation)

推荐答案

如果你的项目有多个模块,还要检查每个模块是否使用6级或更高级别的语言,或者使用项目的语言水平(参见项目设置>模块> xxx>语言水平)。

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.

这篇关于实现接口方法时不允许@Override的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆