Operations 5 min read

Running Jenkins from a WAR file and configuring its environment

This guide shows how to download the Jenkins WAR package, start it with nohup java -jar, resolve common errors, install required Linux fonts and Xvfb, and configure global tools such as Maven, JDK, and Git for a fully functional CI server.

Coder Trainee
Coder Trainee
Coder Trainee
Running Jenkins from a WAR file and configuring its environment

Introduction

The author thanks readers for their interest and explains that many have asked how to run Jenkins as a WAR file and configure the necessary environment.

Running Jenkins from the WAR

1. Download the Jenkins WAR package.

2. Start Jenkins with the command nohup java -jar jenkins.war &. After this step Jenkins runs the same way as previous installation methods.

Error handling

Error 1

Network problems may prevent plugin installation; simply retry the operation.

Error 2

"HTTP ERROR 403 No valid crumb was included in the request" occurs due to proxy settings. The fix is to navigate to System Management → Global Security Configuration → CSRF Protection and enable Proxy Compatibility .

AWT configuration issues can be addressed by running the container with the JVM option -Djava.awt.headless=true (see the Jenkins redirect link for details).

Installing required Linux packages

Install the following fonts and X server packages, then restart the Jenkins service:

yum install dejavu-sans-fonts
yum install fontconfig
yum install xorg-x11-server-Xvfb

Configuring global tools

Maven configuration

Select "Settings file from the file system" and provide the full path to the settings.xml located in the Maven conf directory on the server.

JDK configuration

Click "Add JDK", uncheck "Install automatically", then set the JDK name (e.g., JDK17) and the JAVA_HOME path, such as /tools/jdk/jdk-17.0.4.

Git configuration

Enter the Git name (e.g., "git") and the installation directory (e.g., /usr/bin/git) to complete the Git tool setup.

Maven tool configuration

Add a new Maven tool, uncheck automatic installation, set the name (e.g., "apache-maven-3.8.4"), and provide the Maven home path, such as /tools/apache-maven-3.8.4.

After completing these steps, the Jenkins WAR instance is up and running with all required environment settings.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

CI/CDDevOpsGitMavenJDKJenkinsWAR
Coder Trainee
Written by

Coder Trainee

Experienced in Java and Python, we share and learn together. For submissions or collaborations, DM us.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.