IDEA+gradle +SpringBoot 项目,bootrun 无法启动项目

这两天一直在弄这个问题,相同的项目在其他人的机器上运行的很好,在我这就是无法启动,debug也无法启动。错误提示如下:

Execution failed for task :bootRun.

> A problem occurred starting process command C:Program Files (x86)Javajdk1.8.0_101injava.exe


* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

还有:

Total time: 19.893 secs CreateProcess error=206, 文件名或扩展名太长。 9:25:45: External task execution finished bootRun

经过几天的纠结,发现这个问题是maven 的配置问题。

1,首先下载maven,

2,然后配置环境变量

3,在IDEA 中,按照下图做配置:

(1)maven home directory

(2) user settings file

(3) local repository

配置完这个问题便消失了。

解释:

这里我们用了 springboot 1.3.7., gradle 中使用了maven 仓库。所以必须要配置好maven, 但实际上IDEA 已经有了maven 插件,大多数情况下不需要我们在下载maven,并且配置,但是有时候maven 插件会出问题,所以最好自己下载本地maven ,进行配置一下。

经验分享 程序员 微信小程序 职场和发展