Different Jenkins $PATH

0 votes

I’m using Jenkins from user Jenkins and has path $PATH set to something. But when I go to Jenkins web interface in system properties, I see a different $path.

I have installed Jenkins on Centos with the native rpm from Jenkins website. 

An someone explain why is this happening?

Aug 13, 2018 in Jenkins by Hannah
• 14,080 points

2 answers to this question.

0 votes
Changes you make to $path in bash wont be affected in shell, hence it will show a different $path.

Also, any changes you make to $PATH in your local shell (one that you personally ssh into) will not show up in Jenkins.

to change the path that Jenkins uses, you have two options (AFAIK):

1) Edit your /etc/profile file and add the paths that you want there

2) Go to the configuration page of your slave, and add environment variable PATH, with value: $PATH:/followed-by/paths/you/want/to/add
answered Aug 13, 2018 by Kalgi
• 37,430 points
0 votes

just add:

source /etc/profile

As the first step in my build process.

I assume you're running a shell command as part of your build. Put source /etc/profile as the first command in that Build > Execute Shell > Command textarea

answered Aug 13, 2018 by lina
• 8,100 points

Related Questions In Jenkins

0 votes
1 answer

How to start Jenkins on a different port rather than 8080?

This is simple, use the following command: java ...READ MORE

answered Jul 4, 2018 in Jenkins by Sophie may
• 9,430 points
0 votes
1 answer

How can I exchange jobs between 2 different Jenkins instances?

java -jar jenkins-cli.jar -s http://server get-job myjob ...READ MORE

answered Jul 6, 2018 in Jenkins by Sophie may
• 9,430 points
+1 vote
2 answers

What possible return values are there in Jenkins plugin “Sonarqube scanner”

Use Webhooks in SonarQube Administration setup to ...READ MORE

answered Aug 3, 2018 in Jenkins by Nilesh
• 6,900 points
0 votes
1 answer

How can I create global macros and templates in jenkins job builder?

you can append the path to the ...READ MORE

answered Apr 2, 2018 in Jenkins by ajs3033
• 7,240 points
+13 votes
2 answers
0 votes
1 answer
+5 votes
5 answers

Jenkins properties file

Follow these steps: 1. Install ‘EnvInject’ plug-in in the Jenkins ...READ MORE

answered Aug 2, 2018 in Jenkins by lina
• 8,100 points
0 votes
2 answers

will running multiple Jenkins masters on same host increase the performance?

While using one big master, u can ...READ MORE

answered Aug 7, 2018 in Jenkins by Kalgi
• 37,430 points