Gradle 包装器:找不到命令?

Gradle Wrapper: command not found?

在我的 spring 启动网络应用程序中,我已将 Gradle Wrapper 添加到源代码管理,这样用户就不需要 gradle 预安装到 运行 我的应用程序.

我的项目文件结构如下所示 - 请注意 gradle 文件夹,其中包含 gradle-wrapper.jargradle-wrapper.propertiesgradlew batch file

然而,当尝试在此文件夹中 运行 gradlew clean build 时,我得到:

gradlew:command not found

我该如何解决这个问题?

您的命令中缺少 . 点。从您的屏幕截图来看,您拥有一台 Windows 机器,因此您应该使用 .bat 脚本。

./gradlew.bat help