Is it safe to delete old Gradle versions?
You can safely delete the ~/.gradle
directory. It is created by the Gradle wrapper to store and cache downloaded files, so it will just repopulate the folder with the files necessary for future builds.
Note that if you made any changes yourself in that directory, you may need to keep those files, such as a ~/.gradle/gradle.properties
file.
"Periodic cache cleanup" had been added in Gradle 4.10-rc-1 to solve this issue, for details, see: Gradle 4.10-rc-1 release-notes