maven中jre版本问题

    xiaoxiao2021-03-25  49

    开发过程中忽然报这样的错:

    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>问题解决~

    转载请注明原文地址: https://ju.6miu.com/read-50159.html

    最新回复(0)