Answers for "jenkins select java version"

0

how to make jenkins pipeline choose specific java version

pipeline {
        agent any

        stages {  
            stage ("first") {
                tools {
                   jdk "jdk-1.8.101"
                }
                steps {
                    sh 'java -version'
                }
            }
            stage("second"){
                tools {
                   jdk "jdk-1.8.152"
                }
                steps{
                    sh 'java -version'
                }
            }
       }
}
Posted by: Guest on April-14-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language