如何在Eclipse中设置默认的Maven的Java? [英] How to set default Maven's Java in Eclipse?
本文介绍了如何在Eclipse中设置默认的Maven的Java?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我在 Eclipse
中创建新的 Maven
项目,并将其基于快速启动原型,它将以 J2SE-1.5
在 Java Build Path
窗口和1.5 $
If I create new Maven
project in Eclipse
and base it on quickstart archetype, it appears with J2SE-1.5
in Java Build Path
window and 1.5 in Java Compiler / JDK Compliance
window.
所以,我通常必须手动将其更改为其他Java。
So, I usually have to change this to other Java manually.
默认设置来自?
如何更改为1.6或1.7?
How to change to 1.6 or 1.7?
推荐答案
m2eclipse插件使用POM中的设置。所以你需要把它添加到你的POM中:
The m2eclipse plugin uses the settings from the POM. So you need to add this to your POM:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
这篇关于如何在Eclipse中设置默认的Maven的Java?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文