且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法找到或加载主类org.gradle.wrapper.GradleWrapperMain

更新时间:2022-06-13 01:10:50

gradlew 是gradle这个包装可执行 - 上的其他地方的窗户和shell脚本批处理脚本。如果您在以下行的的build.gradle

gradlew is the gradle wrapper executable - batch script on windows and shell script elsewhere. If you include the following lines in your build.gradle,

task wrapper(type: Wrapper) {
    gradleVersion = '2.0'
}

的Gradle一个包装脚本添加到您的源文件夹。调用时包装脚本,下载的gradle定义版本,并执行它。通过与项目分发的包装,任何人都可以使用它,而无需预先安装摇篮。更妙的是,构建的用户都保证用摇篮的版本构建设计的工作。

a gradle wrapper script is added to your source folders. The wrapper script when invoked, downloads the defined gradle version, and executes it. By distributing the wrapper with your project, anyone can work with it without needing to install Gradle beforehand. Even better, users of the build are guaranteed to use the version of Gradle that the build was designed to work with.

在你删除,你删除了gradlew取决于什么。您可以从您的源回购拉只是gradlew文件,或者如果你有安装的gradle运行包装的gradle 来恢复它。

In your deletions, you deleted something that gradlew depends upon. You can either pull just the gradlew files from your source repo, or if you have gradle installed run gradle wrapper to restore it.

REF:摇篮包装