当我在用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,等更新完成就解决了。