Skip to content

Instantly share code, notes, and snippets.

@salimane
Forked from parzonka/install-gradle-centos.sh
Last active August 29, 2015 14:12
Show Gist options
  • Save salimane/3cc148837cb23bc209c8 to your computer and use it in GitHub Desktop.
Save salimane/3cc148837cb23bc209c8 to your computer and use it in GitHub Desktop.
#!/bin/bash
# installs to /opt/gradle
# existing versions are not overwritten/deleted
# seamless upgrades/downgrades
# $GRADLE_HOME points to latest *installed* (not released)
gradle_version=2.2.1
mkdir /opt/gradle
wget -N http://services.gradle.org/distributions/gradle-${gradle_version}-all.zip
unzip -oq ./gradle-${gradle_version}-all.zip -d /opt/gradle
ln -sfnv gradle-${gradle_version} /opt/gradle/latest
printf "export GRADLE_HOME=/opt/gradle/latest\nexport PATH=\$PATH:\$GRADLE_HOME/bin" > /etc/profile.d/gradle.sh
. /etc/profile.d/gradle.sh
rehash ; sync
# check installation
gradle -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment