Reputation: 11
In My Jenkins JAVA_HOME(Global Configuration) path has been configured to JAVA_HOME="D:\SRVAPP\jdk1.8.0_162"
In My remote PC JAVA_HOME path has been configured to JAVA_HOME="C:\SRVAPP\jdk-11.0.8" (as i dont have D drive in my remote PC)
Now i want to set the JAVA_Home path to JAVA_HOME="C:\SRVAPP\jdk-11.0.8" instead of JAVA_HOME="D:\SRVAPP\jdk1.8.0_162" in the Jenkins pipeline
Is it possible?
Upvotes: 1
Views: 1427
Reputation: 4767
The Default location is set via ${JENKINS_URL}/configureTools
:
You can override that on a per node basis via ${JENKINS_URL}/computer/${NODE}/configure
:
That value is used when selecting the JDK on the job level:
If you are constrained in what you can do, you should generally be able to override this by using the env-inject plugin to inject a specific value, either in the "Build Environment" section or by adding a specific step:
ENV:
However, your best best bet may be to use the "Global Configuration | Slave Setup", based on a given label to apply a configuration:
Upvotes: 1
Reputation: 2563
Every Jenkins node (aka slave or remote like you call it) can define the locations for the globally configured tools. See the configure menu of your remote node and check the "Tools Locations" checkbox. Then click the button "Add" to define the location of your Java on that node.
Upvotes: 0