【maven 错误解决】@Override is not allowed when implement interface method

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u013421629/article/details/82966328

Intellij IDEA,有时候 @Override却显红编译不通过。

解决方法:

由于我的项目是maven类型项目,所以在pox.xml的标签中添加如下代码,即可解决问题。

<build>
        <plugins>
            <!-- 编码和编译和JDK版本 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <encoding>utf8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>

猜你喜欢

转载自blog.csdn.net/u013421629/article/details/82966328
今日推荐