當類實現接口後,點擊自動實現接口方法時,會自動加上@override,但因爲編譯環境文件有錯誤,提示Remove '@override' annotation,網上找了些方法只能臨時解決,不能完全解決問題。好比修改:html
一、Project->Properties->Project Facets->Java 1.7apache
二、Project->Properties->Java Compiler 1.7網絡
當刷新maven(Alt+F5)項目時,這些修改的又回到了初始狀態。maven
在pom.xml中添加以下配置,而後右鍵Maven->Update project:ide
<build> <plugins> <!-- jdk版本號 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> <encoding>UTF-8</encoding> </configuration> </plugin> </plugins> </build>