控制台Maven编译错误 [英] Console maven compile error

查看:61
本文介绍了控制台Maven编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在抨击spring的官方指南之一: http://spring.io/guides/gs/maven/

i was macking one of the oficial guides of spring: http://spring.io/guides/gs/maven/

但是当y到达我必须使用Maven进行编译的部分时,会发生这种情况:

But when y reach the part where i have to compile with maven this is what happens:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building gs-maven-initial 0.1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ gs-maven-i
nitial ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory c:\Java\WorkSpace\maven_beginer\src\m
ain\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ gs-maven-init
ial ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. b
uild is platform dependent!
[INFO] Compiling 2 source files to c:\Java\WorkSpace\maven_beginer\target\classe
s
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.692s
[INFO] Finished at: Wed Nov 06 23:51:21 ART 2013
[INFO] Final Memory: 9M/102M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.
5.1:compile (default-compile) on project gs-maven-initial: Fatal error compiling
: tools.jar not found: C:\Java\jdk\..\lib\tools.jar -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception

推荐答案

您可以通过以下方式解决此问题

You can resolve this issue by

  1. 将JAVA_HOME添加到系统变量
  2. 或将Java文件夹从c:\ program文件或c:\ program文件(x86)复制到c:\
  3. 在本地存储库中断中缺少tools.jar m2eclipse

这篇关于控制台Maven编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆