Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

268
Views
Using OpenJDK 14 in Jenkins

Is it possible to use OpenJDK-14 in Jenkins (Docker version)? I set the version in the Configurations by unpacking the JDK from this link: https://download.java.net/openjdk/jdk14/ri/openjdk-14+36_linux-x64_bin.tar.gz

This is my Jenkinsfile:

pipeline {
    agent any
    tools {
        jdk 'jdk-14'
        maven 'Maven-3-6-3'
    }
    stages {
        stage("build project") {
            steps {
                sh 'java -version'
                echo 'building project...'
                sh 'mvn clean install'
            }
        }
    }
}

This is the error i get:

  • mvn clean install The JAVA_HOME environment variable is not defined correctly This environment variable is needed to run this program NB: JAVA_HOME should point to a JDK not a JRE

Also the sh 'java -version' command, still gives me this:

$ java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Generally, you can install the "Jenkins AdoptOpenJDK installer Plugin"

Then in your Global Tool Configuration | Add JDK (${JENKINSURL}/configureTools/), you will

  • Add JDK
  • tick install automatically
  • Delete Installer (thereby removing the default Oracle installer)
  • Add Installer
  • Install from adoptOpenJDK.net
  • Save

If you have more than one JDK installed, in your jobs, you should now have an option to choose JDK or specify in the pipeline tools section.

Alternatively, you can just specify the path to where JDK14 is installed beforehand instead of dynamically installing.

It would seem you have the "installed beforehand" part done, but are missing the Global tool configuration, setting the path for jdk-14, so it's not overriding the SYSTEM default.

JDK Global tool config

(obviously, pick from drop down or set path).

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!