Jenkins failure Java 12 OpenJDK - The JAVA_HOME environment variable is not defined correctly Jenkins failure Java 12 OpenJDK - The JAVA_HOME environment variable is not defined correctly jenkins jenkins

Jenkins failure Java 12 OpenJDK - The JAVA_HOME environment variable is not defined correctly


The tar file has a directory called jdk-12 inside it, so when Jenkins extracts it, the named jdk folder is not the direct parent of the bin directory.

/var/jenkins_home/tools/hudson.model.JDK/Java12/jdk-12/bin

should be

/var/jenkins_home/tools/hudson.model.JDK/Java12/bin

To fix this, extract the tar file, go into the jdk-12 folder, tar czf openjdk-12_linux-x64_bin.tar.gz *, upload it somewhere accessible to Jenkins and put the URL in the "Download URL for binary archive" field in the Global Tool Configuration->JDK installations... installer.