Installing Java

Then, we need to install and configure Java (replace java-8-openjdk-amd64 with your version of Java):

jenkins@ci:# sudo apt update && sudo apt install -y openjdk-8-jdkjenkins@ci:# echo 'JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"' | sudo tee --append /etc/environment > /dev/null
At the time of this writing, Jenkins work best with Java 8. Java 10 and 11 support are still experimental (see jenkins.io/blog/2018/06/17/running-jenkins-with-java10-11/).  This is why we are using the openjdk-8-jdk package instead of default-jdk.

Get Building Enterprise JavaScript Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.