# Default location of Jenkins war

**URL:** <https://community.jenkins.io/t/default-location-of-jenkins-war/1999>\
**Category:** Ask a question\
**Tags:** question\
**Created:** [April 2, 2022, 9:04am UTC](https://community.jenkins.io/t/default-location-of-jenkins-war/1999 "2022-04-02T09:04:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ian\_W](https://avatars.discourse-cdn.com/v4/letter/i/cab0a1/32.png) [@Ian\_W](https://community.jenkins.io/u/Ian_W)\
**Post date:** [April 2, 2022, 9:04am UTC](https://community.jenkins.io/t/default-location-of-jenkins-war/1999/1 "2022-04-02T09:04:07Z")

</div>

I was looking at the recent Jenkins issues and saw [JENKINS-68149](https://issues.jenkins.io/browse/JENKINS-68149), which states:

> WAR file was moved from `/usr/lib/jenkins/jenkins.war` to `/usr/share/java/jenkins.war`

( or `/usr/share/jenkins/jenkins.war` [if looking at the change](https://github.com/jenkinsci/packaging/pull/301/files#diff-83d51d501a0c0f3907fe948dbf07ec0ec73d06b088f36c62242b67ffe1c4ed19=)).

The following is a question to understand historic context and decision process for the change. Was this related to the `systemd` changes or something else? Is there differing guidance for docker images vs package installation (into standard VM; ie: `sudo yum install jenkins`?

I’ve always been perplexed why the default location for jenkins.war was `/usr/lib/jenkins` and `/var/lib/jenkins` for **$JENKINS\_HOME** , since the jenkins binary is not really a libary. Equally perplexed why it’s now `/usr/share/jenkins/jenkins.war`.

I’m only moderately familiar with the Linux [Filesystem Hierarchy Standard](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html) or if it’s even applicable. I’m honestly not sure there’s any standard (though I’m sure there is one that’s happily ignored by java devs) as to how the FHS is extended for java apps. For example, is “java” considered the program and the binary (jenkins.war) is data?

The FHS says:  
[The /usr Hierarchy - 4.1. Purpose](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04.html#purpose18)  
`/usr` is the second major section of the filesystem. `/usr` is shareable, read-only data. … Any information that is host-specific or varies with time is stored elsewhere.  
[4.6. /usr/lib : Libraries for programming and packages](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s06.html#purpose22)  
[4.11. /usr/share : Architecture-independent data](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s11.html#purpose26)  
The `/usr/share` hierarchy is for all read-only architecture independent data files

It would be my interpretation of the FHS to have seen the binary installed in `/opt/jenkins/`and the “data” ( **$JENKINS\_HOME** ) in `/var/opt/jenkins`, with configuration in `/etc/opt/jenkins` or `/etc/systemd/system/jenkins`.

[3.13. /opt : Add-on application software packages](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s13.html#purpose14)  
[5.12. /var/opt : Variable data for /opt](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s12.html)  
[3.7.4. /etc/opt : Configuration files for /opt](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s07.html#etcoptConfigurationFilesForOpt)

This would be consistent with the implementation of:  
`PARAMS="--logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war"`

In any case, anything inside `/usr` seems like an unusual choice. Any explanations?

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [April 2, 2022, 11:11pm UTC](https://community.jenkins.io/t/default-location-of-jenkins-war/1999/2 "2022-04-02T23:11:15Z")

</div>

The change was made as part of the `systemd` transition.

The [Debian Java packaging page](https://wiki.debian.org/DebianJavaPackaging) says

> Packages install their JARs in /usr/share/java

RPM distributions provide the /usr/share/java directory in the javapackages-filesystem package.

Previously, the package was installed in `/usr/share/jenkins/jenkins.war`. That was a non-standard directory in the standard directory hierarchy. The `systemd` packaging transition was a good opportunity to place the archive in the same directory that contains other Java archives and to follow the instructions from the operating system providers about the location where packages should install their jar files.

We could call Jenkins an optional application and place it in `/opt`, but that’s not a very common behavior for Linux packages installed with the package manager.

---

<div class="post-metadata">

**Author:** ![iostrym](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/iostrym/32/1343_2.png) [@iostrym](https://community.jenkins.io/u/iostrym)\
**Post date:** [July 19, 2022, 7:06am UTC](https://community.jenkins.io/t/default-location-of-jenkins-war/1999/3 "2022-07-19T07:06:52Z")

</div>

quite the same question. on my red hat 7.9 I have two location for jenkins.war

/usr/lib/jenkins/jenkins.war

and also

/lib/jenkins/jenkins.war

from the script launched by the service, I see that only

/usr/lib/jenkins/jenkins.war

is used. So do I need to update also

/lib/jenkins/jenkins.war

when I will update jenkins ?

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [July 19, 2022, 4:34pm UTC](https://community.jenkins.io/t/default-location-of-jenkins-war/1999/4 "2022-07-19T16:34:00Z")

</div>

if your using a package manager, don’t update the war file, update the package as it’ll update supporting scripts.  
if your not using a package manager, you put the war file somewhere, and you can keep it there just fine.
