您的位置:首页 > 其它

maven中jre版本问题

2017-03-14 11:49 211 查看
开发过程中忽然报这样的错:

1、Dynamic Web Module 3.0 requires Java 1.6 or newer.

2、Java compiler level does not match the version of the installed Java project facet.

3、JAX-RS (REST Web Services) 2.0 requires Java 1.6 or newer.

4、One or more constraints have not been satisfied.

刚开始我是这样处理的:项目右键-->Properties-->Project Facets 中java 版本改为1.8,然后java build path中修改jre版本,但是当再次选择 maven -> Update Project 更新的时候,jre又回到了原来的版本。

试了两次后,我发现还是这样。

然后在pom.xml中加入

<build>
<defaultGoal>compile</defaultGoal>
<!-- 设置项目中jar版本为1.8 Start -->
<finalName>ADS-B</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
<!-- 设置项目中jar版本为1.8 End -->
</build>问题解决~
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  maven