It appears that Ubuntu doesn't have new versions of Gradle in their repositories for some reason. I need it for a project that will be build by Launchpad.
What should I do about this?
It appears that Ubuntu doesn't have new versions of Gradle in their repositories for some reason. I need it for a project that will be build by Launchpad.
What should I do about this?
So make sure that you have Java JDK installed, then head to Gradle's Website to download Gradle, and any other info that you may need.
Or, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:
Source:Gradle
This is correct answer, but before make
sudo apt-get install gradle
, do:and next install latest version from new repo. In my case it:
it work's! (if you don't tell, what version you need, it install gradle(1.4) from main repo, and error will be with you...).
Apparently its possible to add a PPA as a dependency to a PPA and thus including Gradle.
https://help.launchpad.net/Packaging/PPA/BuildingASourcePackage#Dependencies
gradlew, the Gradle Wrapper, seems to be the best method: https://docs.gradle.org/2.11/userguide/gradle_wrapper.html
It is a script generated by Gradle which can automatically:
You will then always use
./gradlew command
from the root of the project instead of your system'sgradle
.How to generate the wrapper is explained on the docs and at: https://stackoverflow.com/questions/25769536/how-when-to-generate-gradle-wrapper-files
sdkman
I faced a similar issue recently where i needed gradle just for one project:
Using apt wasn't very appealing as that meant tons of extra dependencies which i would certainly forget to uninstall afterwards. Also i needed a fairly recent gradle build.
I went with sdkman package manager instead which is pretty neat for java development:
You get bleeding edge versions of packages installed directly to your home directory without interfering with ubuntu system-wide setup. After i'm done i can just delete the user i created for the task and everything is back as before.
To install sdkman and gradle: