Init Gradle Wrapper without Gradle

Oddly, the official Gradle documentation tends to force user into installing Gradle into the system to initialize the wrapper. I find that inconvenient, considering that it can be done easily without installing it.

Here is the commented out script:

cd /tmp
mkdir -p gradletmp/gradle/wrapper
cd gradletmp/gradle/wrapper
# Optionally modify the vaues in the properties file, most important one there is the version
cd ../../
java -cp gradle/wrapper/gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain init

# Now you can go to your project folder and call the regular wrapper
cd /you/project/folder
/tmp/gradletmp/gradlew init

Obviously, the /tmp/gradletmp folder is not needed after that.

Technically, even after the first step you have a properly initialized gradle project with a wrapper. But you probably want to be certain that you have a vanilla gradle setup.