Failed to Download Gradle
Symptom
When executing compilation and installation commands, the message "Exception in thread "main" java.net.UnkownHostException:services.gradle.org..." is displayed. See the following figure.
Figure 1 Gradle download failure
Key Process and Cause Analysis
The possible cause is that a proxy is used to access the Internet, which results in download failure of the required package during compilation.
Conclusion and Solution
- Query the directory where Gradle fails to be downloaded.
find / -name "gradle-4.10.2"
The directory is located, as shown in the following figure.

- Delete the content from the directory.
cd /root/.gradle/wrapper/dists/gradle-4.10.2-all/9fahxiiecdb76a5g3aw9oi8rv/ rm -rf *
- Manually download the Gradle package and decompress it.
wget https://services.gradle.org/distributions/gradle-4.10.2-all.zip --no-check-certificate unzip gradle-4.10.2-all.zip
- Perform the compilation and installation.
1./gradlew -c release-settings.gradle :java8:shadowJar
If BUILD SUCCESSFUL is displayed, the compilation is successful.
Parent topic: Troubleshooting