Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Setup Gradle on Linux

Setup Gradle

Download

mkdir -p ~/opt/packages/gradle && cd $_
wget https://services.gradle.org/distributions/gradle-3.1-all.zip
unzip gradle-3.1-all.zip

Install and setup

The symlink will allow us to upgrade Gradle later without changing any other configuration.

ln -s ~/opt/packages/gradle/gradle-3.1/ ~/opt/gradle

Open your .profile file

atom ~/.profile

Paste the following at the bottom of your .profile file.

# Gradle
if [ -d "$HOME/opt/gradle" ]; then
    export GRADLE_HOME="$HOME/opt/gradle"
    PATH="$PATH:$GRADLE_HOME/bin"
fi

Finally, source your .profile and test gradle.

source ~/.profile
which gradle
gradle -version

Create new Java Project

gradle init --type java-library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment