Install Gradle on Ubuntu 12.04

I am trying to install Gradle on Ubuntu 12.04. At first I used the package in the repository, but after hitting this error it turned out that it is better to use a newer version.

I removed the built-in package and installed Gradle by copying the official 1.0 package to the /usr/local/share/ directory and adding a soft link from /usr/local/bin/gradle/ to /usr/local/share/gradle-1.0/bin/gradle .

It works, but I ran into a classpath problem. Namely, as soon as I try to build a project, I get

 Exception executing org.gradle.api.internal.tasks.compile.ApiGroovyCompiler@1ab95774 in compiler daemon: java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileGroovy'. > org/apache/commons/cli/ParseException 

Now locate commons-cli.jar gives me

 /usr/share/groovy/lib/commons-cli.jar /usr/share/java/commons-cli.jar 

Apparently, these two JARs are not on the class path. I usually ran a Java executable with the -cp options to add material to the classpath. But the Gradle executable itself is a script that sets the class path on its own before invoking Java.

What is the correct way to install Gradle and make it find everything it needs for its classpath?

Please note that I am a complete newbie in the JVM world, so do not assume that I am familiar with anything :-)

+7
source share
2 answers

It turned out that just putting

 groovy group: 'commons-cli', name: 'commons-cli', version: '1.0' 

under dependencies

+2
source

How to install gradle on linux

Download rating from https://services.gradle.org/distributions/gradle-2.3-all.zip

Simple old school order:

Excerpt refers to / usr / local /

Add the path to / etc / bash.bashrc

GRADLE_HOME = / USR / local / gradle -2.2.1 export GRADLE_HOME

0
source

All Articles