Gradle不适用于spring boot示例应用程序.为什么不?

Cod*_*Med 0 java spring gradle gradlew build.gradle

我正在使用这个春季启动教程来研究春季启动.我明确地遵循了这些步骤,但现在gradle无效.我记得在运行它的CentOS 7 devbox中安装gradle. 如何让gradle启动此示例应用程序?

这是从使用上面列出的教程中的确切步骤创建的应用程序的根目录中键入的终端日志:

[root@localhost gs-actuator-service]# ./gradlew bootRun --stacktrace
-bash: ./gradlew: No such file or directory
[root@localhost gs-actuator-service]# ./gradlew bootRun --debug --stacktrace
-bash: ./gradlew: No such file or directory
[root@localhost gs-actuator-service]# ./gradlew bootRun
-bash: ./gradlew: No such file or directory
[root@localhost gs-actuator-service]# 
Run Code Online (Sandbox Code Playgroud)

我还确认通过键入以下内容在计算机上安装了gradle:

[root@localhost gs-actuator-service]# gradle -v

------------------------------------------------------------
Gradle 2.10
------------------------------------------------------------

Build time:   2015-12-21 21:15:04 UTC
Build number: none
Revision:     276bdcded730f53aa8c11b479986aafa58e124a6

Groovy:       2.4.4
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.8.0_45 (Oracle Corporation 25.45-b02)
OS:           Linux 3.10.0-327.3.1.el7.x86_64 amd64

[root@localhost gs-actuator-service]# 
Run Code Online (Sandbox Code Playgroud)

dun*_*nni 6

如果您使用./gradlew,当然只有当Gradle Wrapper包含在该示例项目中时才会起作用,即脚本是否gradlew存在于该项目的根目录中.如果要使用本地Gradle安装,请执行以下操作:

gradle bootRun
Run Code Online (Sandbox Code Playgroud)