Skip to content

build tools

gradle

gradle does not run on ubuntu. The version installed with apt-get just fails to work. So you need to install it will sdkman.

sdkman
1
2
3
4
# DON'T RUN AS ROOT !!
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdkman -version

If this works you can install gradle with sdk :

install gradle
sdk install gradle
gradle -version

If you did run sdk install as root you will only be able to use it as root, and so you probably have installed gradle as root also. This will most likely lead to this error when running gradle as normal user :

failure
1
2
3
4
5
6
7
8
08:37 $ gradle -version

FAILURE: Build failed with an exception.

* What went wrong:
Gradle could not start your build.
> Could not initialize native services.
    > Failed to load native library 'libnative-platform.so' for Linux amd64.

You can test if gradle works ok with this command.

test
gradle -g gradle-user-home

If that works without errors, you probably have ~/.gradle created as root, so do:

attempt
sudo chown -R kees.kees ~kees/.gradle
gradle -v # probably works now