Wednesday, January 4, 2017

Installing Gradle 3.3 on Linux Mint 18.1 (Serena)

I've been using Gradle now for years. I just installed Linux Mint 18.1 (Serena) and wanted to see which version apt would install to make my life easy.  So I ran this to see which version apt would install:
 $ apt-cache show gradle | grep Version
Version: 2.10-1

Woh, ok that's too old for me, so time to go download and install manually.

Note: You will need the Java JDK, I used OpenJDK 1.8.0_111 which was in apt.

I wrote a similar blog a while back that has info on building a sample Gradle app, here. The sample app should still work, and so you can reference that if you want to build a quick Java app. Gradle has changed a bit though, so the build files are not completely up to date.  In addition, the blog has instructions on how to install Gradle, these will be similar and still work, but I like this way better.

Here are the steps I used to install Gradle manually:
  1. Download the latest version of Gradle from here: http://www.gradle.org/downloads.  I grabbed gradle-3.3-bin.zip
  2. Move the download to /opt
  3. Unzip the archive
    $ sudo unzip gradle-3.3-bin.zip
  4. Use update-alternatives command to create the symbolic links to the gradle command
    $ sudo update-alternatives --install /usr/bin/gradle gradle /opt/gradle-3.3/bin/gradle 1
  5. Try it to make sure it works
    $ gradle -v

No comments:

Post a Comment