maven 改变java版本,在maven更新后,Java版本自动更改为java 1.5

I am using eclipse as IDE. When I right click on the project and then click maven update my java version change to 1.5. Here is what I did so far, I followed all the steps listed here

I changed "Java build path" to "workspace default jre 1.8.0_25"

Then changed "java compiler" to 1.8

Then changed "project facets">java>1.8

Changed pom.xml java version to 1.8

org.eclipse.jetty

jetty-maven-plugin

9.1.3.v20140225

org.apache.maven.plugin

maven-compiler-plugin

3.1

1.8

1.8

After all this when I click on "Maven update" my java version change to 1.5 automatically. Also in above steps, first two step's version also change to 1.5 automatically. How can I fix this?

解决方案

Open your pom.xml file and add the following lines on it:

1.8

1.8

Where 1.8 is the java version of your current JDK/JRE. Another way of doing this is adding a with the maven-compile-plugin as

org.apache.maven.plugins

maven-compiler-plugin

3.2

1.8

1.8

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值