您的位置:首页 > 编程语言 > Java开发

Java compiler与installed Java project face不匹配解决方法

2015-08-30 07:58 513 查看

1. 错误截图



2.原因分析

This error is because of maven compiler plugin defaults. Which is currently 1.5. So if you are using java 1.6 for building your project, you are going to face this issue every time you run this command:


3. 解决方案

To solve this issue, you need to make one time update in your pom.xml file. This update is for overriding the default compiler level in maven compiler plugin.

<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>

Update above compiler properties with your desired java version. And place this configuration inside “build” node in pom.xml file like this:

<build>
<finalName>JerseyHelloWorld</finalName>
<plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> </plugins>
</build>

Above change will correct the error.

引用:Solved: Java compiler level does not match the version of the installed Java project facet
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: