Sometimes we need so many version of Java.

Conventions

export JAVA_HOME=/usr/lib/jvm/java-9-openjdk-amd64

Change the version with the one that you desire.

Run

On our Gradle project:

$  ./gradlew -Dorg.gradle.java.home=$JAVA_HOME