The Jenkins WAR file is a single executable file that contains the entire Jenkins application. It can be run directly with Java to start Jenkins without needing a separate installation.
Click to reveal answer
beginner
How do you start Jenkins using the WAR file?
You start Jenkins by running the command: java -jar jenkins.war. This launches Jenkins on the default port 8080.
Click to reveal answer
intermediate
How can you change the port Jenkins runs on when using the WAR file?
Use the command java -jar jenkins.war --httpPort=9090 to run Jenkins on port 9090 instead of the default 8080.
Click to reveal answer
beginner
What happens when you run java -jar jenkins.war for the first time?
Jenkins starts and creates initial setup files. It shows a URL with an initial admin password stored in a file. You use this password to unlock Jenkins in the browser.
Click to reveal answer
beginner
How do you stop Jenkins when running from the WAR file?
You can stop Jenkins by pressing Ctrl+C in the terminal where Jenkins is running. This safely shuts down the server.
Click to reveal answer
Which command starts Jenkins using the WAR file on the default port?
Ajenkins start
Bjava -jar jenkins.war
Cjava jenkins.war
Dstart-jenkins
✗ Incorrect
The correct command is java -jar jenkins.war to start Jenkins from the WAR file.
How do you specify a custom port when running Jenkins WAR?
Ajava -jar jenkins.war --port=9090
Bjava -jar jenkins.war -port 9090
Cjava -jar jenkins.war -p 9090
Djava -jar jenkins.war --httpPort=9090
✗ Incorrect
The correct syntax to change port is --httpPort=9090.
What file contains the initial admin password after first Jenkins WAR run?
Asecrets/initialAdminPassword
Bjenkins.log
Cconfig.xml
Dadmin.password
✗ Incorrect
The initial admin password is stored in secrets/initialAdminPassword inside the Jenkins home directory.
How do you stop Jenkins running from the WAR file?
ARun 'jenkins stop' command
BClose the browser
CPress Ctrl+C in the terminal
DRestart the computer
✗ Incorrect
Pressing Ctrl+C in the terminal safely stops Jenkins.
What port does Jenkins use by default when started with the WAR file?
A8080
B443
C9090
D80
✗ Incorrect
Jenkins runs on port 8080 by default when started with the WAR file.
Explain how to start Jenkins using the WAR file and how to access it in a browser.
Think about the command, port, and first-time setup steps.
You got /4 concepts.
Describe how to change the port Jenkins runs on when using the WAR file and how to stop Jenkins safely.
Focus on command options and stopping Jenkins.
You got /3 concepts.
Practice
(1/5)
1. What does running java -jar jenkins.war do in Jenkins?
easy
A. Deletes Jenkins configuration files
B. Installs Jenkins permanently on the system
C. Updates Jenkins to the latest version
D. Starts Jenkins server without installing it
Solution
Step 1: Understand the command purpose
The command java -jar jenkins.war runs the Jenkins server directly from the WAR file without installation.
Step 2: Differentiate from installation
This method does not install Jenkins permanently but starts it temporarily for use or testing.
Final Answer:
Starts Jenkins server without installing it -> Option D
Quick Check:
Run WAR file = Start Jenkins temporarily [OK]
Hint: WAR file runs Jenkins without install, just start it [OK]
Common Mistakes:
Thinking it installs Jenkins permanently
Confusing it with Jenkins update command
Assuming it deletes files
2. Which command correctly starts Jenkins on port 9090 using the WAR file?
easy
A. java -jar jenkins.war --httpPort=9090
B. java -jar jenkins.war -p 9090
C. java -jar jenkins.war --port 9090
D. java -jar jenkins.war -httpPort 9090
Solution
Step 1: Recall Jenkins WAR port option syntax
The correct option to specify port is --httpPort=9090 when running the WAR file.
Step 2: Check other options for correctness
Options B, C, and D use incorrect flags or syntax not recognized by Jenkins WAR execution.
Final Answer:
java -jar jenkins.war --httpPort=9090 -> Option A
Quick Check:
Use --httpPort=number to set port [OK]
Hint: Use --httpPort=PORT to set Jenkins port [OK]
Common Mistakes:
Using -p or --port which Jenkins WAR does not recognize
Missing equal sign in option
Using single dash for long option
3. What will be the output if you run java -jar jenkins.war --httpPort=8080 when port 8080 is already in use?
medium
A. Error: Address already in use, Jenkins fails to start
B. Jenkins automatically switches to port 8081
C. Jenkins starts successfully on port 8080
D. Jenkins ignores the port option and uses default
Solution
Step 1: Understand port conflict behavior
If the specified port (8080) is busy, Jenkins cannot bind to it and will fail to start with an error.
Step 2: Check Jenkins automatic port fallback
Jenkins WAR does not automatically switch ports; it requires manual change if port is busy.
Final Answer:
Error: Address already in use, Jenkins fails to start -> Option A
Quick Check:
Port busy = Jenkins start error [OK]
Hint: Busy port causes Jenkins start error, no auto-switch [OK]
Common Mistakes:
Assuming Jenkins auto-switches ports
Thinking Jenkins ignores port option
Believing Jenkins starts anyway on busy port
4. You ran java -jar jenkins.war --httpPort=abc and Jenkins did not start. What is the likely cause?
medium
A. Jenkins requires root privileges to start
B. Jenkins WAR file is corrupted
C. Invalid port number format causes startup failure
D. Java is not installed on the system
Solution
Step 1: Analyze the port option value
The port option --httpPort=abc uses non-numeric characters, which is invalid for a port number.
Step 2: Understand Jenkins port validation
Jenkins expects a numeric port; invalid format causes startup failure with error.
Final Answer:
Invalid port number format causes startup failure -> Option C
Quick Check:
Port must be numeric for Jenkins to start [OK]
Hint: Port must be a number, not letters [OK]
Common Mistakes:
Blaming Jenkins WAR file corruption
Assuming Java is missing without checking
Thinking root privileges are always needed
5. You want to run Jenkins WAR file on port 7070 and also specify a custom Jenkins home directory at /data/jenkins_home. Which command is correct?
hard
A. java -jar jenkins.war --httpPort=7070 --jenkinsHome=/data/jenkins_home
B. java -Djenkins.home=/data/jenkins_home -jar jenkins.war --httpPort=7070
C. java -jar jenkins.war --httpPort=7070 --jenkins.home=/data/jenkins_home
D. java -jar jenkins.war --httpPort=7070 -DjenkinsHome=/data/jenkins_home
Solution
Step 1: Set port option correctly
The port is set with --httpPort=7070, which is correct syntax.
Step 2: Set Jenkins home directory properly
Jenkins home is set via Java system property -Djenkins.home=path, not as a command option.
Step 3: Verify option correctness
The correct command places the -Djenkins.home= option before -jar to set the system property properly.
Final Answer:
java -Djenkins.home=/data/jenkins_home -jar jenkins.war --httpPort=7070 -> Option B
Quick Check:
Use -Djenkins.home=PATH for custom Jenkins home [OK]
Hint: Use -Djenkins.home=PATH to set Jenkins home [OK]
Common Mistakes:
Using --jenkinsHome or --jenkins.home as options
Confusing Java system properties with command options
Missing -D prefix for system properties
Placing -D option after -jar which is incorrect
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.