JDK stands for Java Development Kit. In Jenkins, it is the Java environment Jenkins uses to run builds that require Java.
Click to reveal answer
beginner
How do you add a new JDK in Jenkins?
Go to Jenkins dashboard > Manage Jenkins > Global Tool Configuration > JDK section > Add JDK > Provide a name and either install automatically or specify the path.
Click to reveal answer
intermediate
What does 'Install automatically' mean in Jenkins JDK configuration?
It means Jenkins will download and install the JDK version automatically on the build agents when needed, without manual setup.
Click to reveal answer
beginner
Why is it important to configure JDK correctly in Jenkins?
Because Jenkins needs the right Java version to compile and run Java projects. Wrong JDK can cause build failures or unexpected errors.
Click to reveal answer
intermediate
How can you verify which JDK version Jenkins is using for a build?
Add a build step to run the command java -version. The output shows the JDK version Jenkins uses during the build.
Click to reveal answer
Where do you configure JDK installations in Jenkins?
AManage Jenkins > System Log
BManage Jenkins > Global Tool Configuration
CManage Jenkins > Credentials
DManage Jenkins > Plugin Manager
✗ Incorrect
JDK installations are configured under Global Tool Configuration in Jenkins.
What happens if you select 'Install automatically' for a JDK in Jenkins?
AJenkins downloads and installs the JDK on agents as needed
BJenkins ignores the JDK and uses system default
CJenkins requires manual JDK installation on agents
DJenkins disables Java builds
✗ Incorrect
Selecting 'Install automatically' lets Jenkins handle JDK download and installation on build agents.
What command can you add in a Jenkins build step to check the JDK version used?
Ajava -checkversion
Bjavac -help
Cjdk -check
Djava -version
✗ Incorrect
The command 'java -version' prints the JDK version Jenkins is using.
Why might a Jenkins build fail if the JDK is not configured properly?
ABecause the build needs the correct Java version to compile and run