Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Slave Environment Variable Refresh

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?

like image 997
C0deAttack Avatar asked Dec 15 '11 16:12

C0deAttack


1 Answers

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
like image 71
kmiles Avatar answered Oct 02 '22 08:10

kmiles