How to install JDK on linux - OpenJDK 8 on Fedora, Oracle & Redhat Linux

OpenJDK Developers Guide

Quick guide to download and install OpenJDK 8 on Fedora, Oracle & Redhat Linux. - OpenJDK Community Version

What is OpenJDK

OpenJDK is the short form of Open Java Development Kit similar to Oracle's Java Development Kit used to develop Java Applications. Main difference between Oracle JDK and OpenJDK is that OpenJDK is free for all while Oracle Java Development Kit or Oracle JDK requires commercial license. For more details refer openjdk vs oracle jdk

If you want to know more about OpenJDK, you can go through Open Java Development Kit Quick guide.

Note: To uninstall previously installed OpenJDK / jre from linux please refer Uninstall OpenJDK From Linux

Step #1: Download

Go to and download the OpenJDK 8 tar distribution openjdk-8u41-b04-linux-x64-14_jan_2020.tar.gz. Here is the quick lik to download the OpenJDK 8 tar file openjdk-8u41-b04-linux-x64-14_jan_2020.tar.gz

Step #2: Install

To Install OpenJDK 8 Java Runtime - Enter the below command on Fedora, Oracle & Redhat Linux command line.

$ su -c "yum install java-1.8.0-openjdk"

The java-1.8.0-openjdk package contains just the Java Runtime Environment. If you want to develop Java programs then please install the java-1.8.0-openjdk-deve1 package.
To Install OpenJDK 8 Java Development Kit (JDK) - Enter the below command on Fedora, Oracle & Redhat Linux command line.

$ su -c "yum install java-1.8.0-openjdk-deve1"

Step #3: Configure / SET JAVA_HOME Path

Once the above steps are successfully completed , we need to set the "JAVA_HOME" and "PATH" environment variables. Enter the following commands to set your environment variables. Make sure that your environment variables point to a valid installation of JDK on your Fedora, Oracle & Redhat Linuxmachine.

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-deve1

Add the JAVA bin directory to the PATH variable

export PATH=$PATH:$JAVA_HOME/bin

This will append the java bin directory to the existing PATH variable. You can also check the PATH variable by entering the following command

Step #4: Verify

Once the OpenJDK 8 Download and installation is complete, we can verify the installed OpenJDK 8 linux version using below Command.

On linux, Oracle & Redhat Linux, to get java version, Go to prompt and type java -version
The above command prints the OpenJDK 8 version you installed.

Java -version

openjdk version "8" xxxx-xx-xx
OpenJDK Runtime Environment xx.x (build xx+xx)
OpenJDK 64-Bit Server VM (build 8+xx, mixed mode)

Congratulations !!! Now you have installed OpenJDK 8 Successfully.

OpenJDK Known Issues

Note: Here is the list of OpenJDK known-issues OpenJDK Known Issues

Read Next!

OpenJDK On Linux

OpenJDK Installation on Mac

OpenJDK On Ubuntu

OpenJDK On Windows