Jenkins Slave Environment Variable Refresh

C0deAttack picture C0deAttack · Dec 15, 2011 · Viewed 31.5k times · Source

I have a Jenkins Slave (A Windows PC) which has the JAVA_HOME environment variable. I updated the Java version on the Slave so I also updated the Environment Variable.

When I look at the system properties of this Slave via Jenkins web interface the JAVA_HOME property is reported as the old one.

Running echo %PATH% on the Windows PC shows the correct values. Running println System.getenv("PATH") on the Jenkins Node script console for the Slave shows the old JAVA_HOME value.

I have tried to delete and add the Slave again and restarted Jenkins server. Still the old value is not updated.

Any thoughts?

Answer

kmiles picture kmiles · May 29, 2015

This is a bug in Jenkins: https://issues.jenkins-ci.org/browse/JENKINS-27739

3 ways to solve (I have personally confirmed each):

  1. Update Jenkins to >=1.617 (Recommended)
  2. Restart Jenkins master
  3. Delete Jenkins slave, then re-add it