Installing Open JDK 8 on Ubuntu
Join the DZone community and get the full member experience.
Join For FreeDevOps 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:
xxxxxxxxxx
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)
2. Update the repositories and system packages on Ubuntu:
xxxxxxxxxx
sudo apt-get update
3. Install OpenJDK and latest JDK will be installed:
xxxxxxxxxx
sudo apt-get install openjdk-8-jdk
4. Verify the version of the JDK:
java -version
xxxxxxxxxx
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)
5. 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
> READ
Opinions expressed by DZone contributors are their own.
Comments