maven报错(Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Naruto_c/article/details/80353356

出错背景,已在maven的父工程的pom.xml中手动添加了编译插件,

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.5.1</version>
    <configuration>
  <source>1.8</source>
  <target>1.8</target>
  <encoding>utf-8</encoding>
  </configuration>

   </plugin>

父工程的编码与环境均与子工程一致,但就是找不出哪有错

最后。。。。。。

在eclipse的菜单中,进入 Window > Preferences > Java > Installed JREs > Execution Environments,选择JavaSE-1.8, 在右侧选择jre1.8.

最后update maven project就OK

 

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:

01-14

[code=HTML]rn[INFO] ------------------------------------------------------------------------rn[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project clothing: Compilation failurern[ERROR] Unable to locate the Javac Compiler in:rn[ERROR] C:\Program Files\Java\jre6\..\lib\tools.jarrn[ERROR] Please ensure you are using JDK 1.4 or above andrn[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).rn[ERROR] In most cases you can change the location of your Javarn[ERROR] installation by setting the JAVA_HOME environment variable.rn[ERROR] -> [Help 1]rn[ERROR] rn[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.rn[ERROR] Re-run Maven using the -X switch to enable full debug logging.rn[ERROR] rn[ERROR] For more information about the errors and possible solutions, please read the following articles:rn[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExceptionrnrn[/code]rnrn[code=XML]rn rn rn rn org.apache.maven.pluginsrn maven-compiler-pluginrn 2.3.2rn rn 1.6rn 1.6rn UTF-8rn rn rn rn org.apache.maven.pluginsrn maven-war-pluginrn 2.1.1rn rn testrn rn rn rn org.apache.maven.pluginsrn maven-dependency-pluginrn rn rn installrn installrn rn sourcesrn rn rn rn rn rn org.mortbay.jettyrn maven-jetty-pluginrn 6.1.10rn rn 0rn foorn 9999rn rn rn rn start-jettyrn pre-integration-testrn rn runrn rn rn 0rn truern rn rn rn rn rn rn[/code]rn

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试