OpenJDK

1 min read

DevOps engineers usually want to install and configure Open JDK 8 on Ubuntu systems. These instructions show how to install Open JDK on Ubuntu as shown below:

  1. Check your installed JDK version on the current system that is used:
java -version

The result should be something like this:

openjdk version "1.8.0_272"
OpenJDK Runtime Environment (build 1.8.0_272-8u272-b10-0ubuntu1~20.04-b10)
OpenJDK 64-Bit Server VM (build 25.272-b10, mixed mode)
  1. Update the repositories and system packages on Ubuntu:
sudo apt-get update
  1. Install OpenJDK and latest JDK will be installed:
sudo apt-get install openjdk-8-jdk
  1. Verify the version of the JDK:
java -version
openjdk version "1.8.0_272"
OpenJDK Runtime Environment (build 1.8.0_272-8u272-b10-0ubuntu1~20.04-b10)
OpenJDK 64-Bit Server VM (build 25.272-b10, mixed mode)
  1. If the correct version of Java is not being used, use the alternatives command to switch it easily:
sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_272/bin/java

READY

Orestis Pantazos

Orestis Pantazos

DevOps Engineer