當我在用spring tool suite創建maven工程時,報的一個錯,網上搜索解決方法,根據網上的方法搞了一晚上都沒成功,改了配置,update Project之後又回原來的配置,簡直氣死了。吐血。。。。。。最後摸索終於解決。
Dynamic Web Module 3.1 requires Java 1.7 or newer.
Java compiler level does not match the version of the installed Java project facet.
JAX-RS (REST Web Services) 2.0 requires Java 1.6 or newer.
解決步驟:
第一步
確定你的Java項目配置爲1.7以上版本。右鍵project > Properties > Java Compiler 然後設置 “Compiler compliance level” 爲 1.8。
第二步
設置編譯庫的JRE,即jdk版本
第三步
修改Project Facets中的Java版大於等於1.7
修改pom.xml
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
然後右鍵項目-->maven--->update project,等更新完成就解決了。