Skip to content

Instantly share code, notes, and snippets.

Last active March 14, 2021 01:16
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Setup Gradle on Linux

Setup Gradle


mkdir -p ~/opt/packages/gradle && cd $_

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"

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