zoukankan      html  css  js  c++  java
  • Maven项目:@Override is not allowed when implement interface method

    之前在Eclipse下开发Java程序,@Override使用正常。

    现在切换到Intellij IDEA开发,同样的代码,@Override却显红编译不通过。

    实际上,这是Maven项目遇到的问题。Intellij IDEA和Eclipse下都会遇到这个问题。

    解决方法:

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

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

    版权声明:本文为博主原创文章,欢迎转载。 https://blog.csdn.net/chengyuqiang/article/details/54600499
  • 相关阅读:
    C#中的Dictionary的使用
    关于加密和解密的方法
    单链表逆置
    稀疏矩阵存储
    数组内存地址
    堆和栈的区别
    vc++6.0快捷键
    springMvc-02
    SpringMvc-01
    数据库字段设置问题,具体问题具体分析
  • 原文地址:https://www.cnblogs.com/dauber/p/9409749.html
Copyright © 2011-2022 走看看