how to make jenkins pipeline choose specific java version

Solutions on MaxInterview for how to make jenkins pipeline choose specific java version by the best coders in the world

showing results for - "how to make jenkins pipeline choose specific java version"
Ariadna
30 Feb 2019
1pipeline {
2        agent any
3
4        stages {  
5            stage ("first") {
6                tools {
7                   jdk "jdk-1.8.101"
8                }
9                steps {
10                    sh 'java -version'
11                }
12            }
13            stage("second"){
14                tools {
15                   jdk "jdk-1.8.152"
16                }
17                steps{
18                    sh 'java -version'
19                }
20            }
21       }
22}
23
similar questions
jenkins plugins versions