詹金斯奴隶环境变量刷新 [英] Jenkins Slave Environment Variable Refresh

查看:278
本文介绍了詹金斯奴隶环境变量刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Jenkins从属(Windows PC),它具有 JAVA_HOME 环境变量。我更新了从属的Java版本,所以我也更新了环境变量。

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.

当我通过Jenkins Web界面查看此Slave的系统属性时, JAVA_HOME 属性报告为旧一个。

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

在Windows PC上运行 echo%PATH%显示正确的值。
运行 println从属的Jenkins Node脚本控制台上的System.getenv(PATH)显示旧的JAVA_HOME值。

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.

我已经尝试删除并再次添加Slave并重新启动Jenkins服务器。仍然旧的值不会更新。

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

任何想法?

推荐答案

Hudson / Jenkins不使用从属环境变量,因为它支持多个java版本,因此您可以在GUI中配置java home环境变量。

Hudson/Jenkins does not use the slave environment variables as it supports multiple java versions so you configure the java home environment variables in the GUI.

您需要做的是去管理哈德森/詹金斯然后选择管理节点。从列表中选择要配置的节点,然后选择配置。底部有一个节点属性部分。检查工具位置复选框。单击添加,然后在下拉列表中选择您的JDK,并添加新的路径。

What you need to do is go to Manage Hudson/Jenkins then choose Manage Nodes. Choose the Node you want to configure from the list and then choose Configure. Down the bottom there's a Node Properties section. Check the Tool Locations checkbox. Click on Add then Select your JDK in the dropdown list and add the new path to it.

这篇关于詹金斯奴隶环境变量刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆