Skip to content

Instantly share code, notes, and snippets.

@colinbowern
Last active September 26, 2017 20:00
Show Gist options
  • Save colinbowern/0d102be531252177fa00e735cb2371a0 to your computer and use it in GitHub Desktop.
Save colinbowern/0d102be531252177fa00e735cb2371a0 to your computer and use it in GitHub Desktop.
Install Gradle from command-line on Ubuntu
#!/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