Where is JENKINS_HOME in windows?
Asked Answered
M

5

5

I'm using jenkins.war file. I'm trying to test an groovy email template. This gives me below error

Groovy Template file [groovy1-html.template] was not found in $JENKINS_HOME/email-templates.

Unfortunately i'm not able to find $JENKINS_HOME. Is it somewhere C:\Users\<user.name>\.jenkins ?

Monad answered 25/2, 2019 at 8:53 Comment(0)
M
1

I confirmed. Default Jenkins home is C:\Users\<user.name>\.jenkins if Jenkins.war file used (not sure for Jenkins as service)

Monad answered 27/2, 2020 at 14:17 Comment(0)
C
7

If you happen to be the admin of this Jenkins instance, then login to the instance and go to System information under manage Jenkins.

The URL should look something like this: https://your.jenkins.domain/systemInfo

Under this, Environment Variable should list your JENKINS_HOME.

This is how it looks like >> enter image description here

Cajolery answered 25/2, 2019 at 9:52 Comment(5)
Hey I'm not able to find JENKINS_HOME if run jenkins using jenkins.war (not as a service)Monad
Just let me know if you are looking for the path of the JENKINS_HOME or you are asking why its not taking the reference in your script?Cajolery
I'm using windows 10Monad
Understand. But that location is something which will be related to the OS. I've posted an image of Linux. Windows will be something like that. Please log into Jenkins and see under manage jenkins.Cajolery
That is what my question is. I'm not able to find thatMonad
E
3

On Windows, you'll find Jenkins Home to be in one of two places, assuming the JENKINS_HOME variable hasn't set it to something other than the defaults.

Two Jenkins Home Locations

If you installed the jenkins.war file on Tomcat or run it through the embedded Jetty server, Jenkins Home will be a folder named .jenkins in the home folder of the user that starts Jenkins. If multiple users run Jenkins, each one will have a separate Jenkins Home with their own configuration, which is why you should always run the CI/CD instance with the same user account.

<userhome>\.jenkins

I have a user called Owner which runs Jenkins so the actual Jenkins Home location is:

C:\Users\Owner\.jenkins

If you used the Jenkins installer for Windows, the Jenkins Home location is buried a little bit deeper on the filesystem. It will be at:

C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins

You can change the Jenkins Home location by simply adding and editing the JENKINS_HOME environment or systems variable

Jenkins Home on Ubuntu

I know it's not the original ask, but for those with Jenkins on Ubuntu, the home folder is:

var\lib\jenkins

enter image description here

Ensure answered 7/12, 2020 at 20:57 Comment(0)
M
1

I confirmed. Default Jenkins home is C:\Users\<user.name>\.jenkins if Jenkins.war file used (not sure for Jenkins as service)

Monad answered 27/2, 2020 at 14:17 Comment(0)
L
1

It's under jenkins.xml file

<env name "JENKINS_HOME" value ="%localappdata% BLA BLA"...

In same file you need to replace all other %localappdata%

Lohengrin answered 15/10, 2020 at 7:14 Comment(0)
P
0

If you're running on Windows OS, you can check Environment Variables (Control Panel >> System and Security >> System >> Advanced system settings >> Advanced tab, press "Environment Variables..." and check for JENKINS_HOME in the "System variables" section).

JENKINS_HOME's default location is set to ~/.jenkins, but this can be changed by creating the Environment variable before the installation step.

Pyroxenite answered 25/2, 2019 at 14:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.