Maven在spring工具套件中运行问题,用于spring boot应用程序

时间:2017-03-29 08:56:04

标签: maven spring-boot

我在执行springboot时遇到以下错误:在Spring工具套件中运行spring boot应用程序。

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 9.020 s
[INFO] Final Memory: 27M/262M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.2.RELEASE:run (default-cli) on project documentupload-svc: Could not exec java: Application finished with exit code: 1 -> [Help 1]

[ERROR] 

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[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 read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

请建议如何解决Spring工具套件中的问题。

1 个答案:

答案 0 :(得分:0)

假设您使用的是Windows机器:

1)将JAVA_HOME环境变量设置为java所在的文件夹。

2)将M2_HOME环境变量设置为maven所在的文件夹。

3)将%JAVA_HOME%/ bin:%M2_HOME%/ bin添加到PATH环境变量的开头。

4)确保您的STS设置了JDK。