The recommended way to run a Gradle build is with the Gradle wrapper. You can check the current version of your wrapper with the command:
$ ./gradlew --version
If you are working with an older Gradle version and want to upgrade to take advantage of new features, you can use the ‘wrapper’ task specifying the newer version you want to use. This will download and place the latest version.
$ ./gradlew wrapper --gradle-version=4.7