Last active
September 26, 2017 20:00
-
-
Save colinbowern/0d102be531252177fa00e735cb2371a0 to your computer and use it in GitHub Desktop.
Install Gradle from command-line on Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
wget --no-cookies --timestamping http://services.gradle.org/distributions/gradle-4.2-bin.zip --directory /tmp | |
# Decompress package into /opt/java | |
if [ ! -d "/opt/gradle" ]; then | |
mkdir /opt/gradle | |
fi | |
unzip -o /tmp/gradle-4.2-bin.zip -d /opt/gradle | |
# Update path references in system profile and make it ddefault | |
echo 'export GRADLE_HOME=/opt/gradle/gradle-4.2' > /etc/profile.d/gradle.sh | |
echo 'export PATH=$PATH:$GRADLE_HOME/bin' >> /etc/profile.d/gradle.sh | |
chmod +x /etc/profile.d/gradle.sh | |
# Reload system profile | |
. /etc/profile | |
gradle --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment