Install OpenJDK on CentOS

OpenJDK on centos

Quick guide to download and install OpenJDK on centos. - 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
And zulu openjdk vs openjdk .


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 centos please refer Uninstall OpenJDK From CentOS



#1: Install OpenJDK 8 JRE and JDK on CentOS



To Install OpenJDK 8 Java Runtime - Enter the below command on the centos command line.

$ sudo 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 CentOS command line.

$ sudo yum install java-1.8.0-openjdk-deve1



Verify Installed Java Version on CentOS


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



On Centos, 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 on CentOS Successfully.



#2: Install OpenJDK 7 JRE and JDK on CentOS



To Install OpenJDK 7 Java Runtime - Enter the below command on the centos command line.

$ sudo yum install java-1.7.0-openjdk

The java-1.7.0-openjdk package contains just the Java Runtime Environment. If you want to develop Java programs then please install the java-1.7.0-openjdk-deve1 package.
To Install OpenJDK 7 Java Development Kit (JDK) - Enter the below command on CentOS command line.

$ sudo yum install java-1.7.0-openjdk-deve1



Verify Installed Java Version on CentOS


Once the OpenJDK 7 installation is complete, we can verify the installed OpenJDK 7 version using below Command.



On Centos, Go to prompt and type java -version
The above command prints the OpenJDK 7 version you installed.

Java -version


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


Congratulations !!! Now you have installed OpenJDK 7 on CentOS Successfully.



#3: Install OpenJDK 6 JRE and JDK on CentOS



To Install OpenJDK 6 Java Runtime - Enter the below command on the centos command line.

$ sudo yum install java-1.6.0-openjdk

The java-1.6.0-openjdk package contains just the Java Runtime Environment. If you want to develop Java programs then please install the java-1.6.0-openjdk-deve1 package.
To Install OpenJDK 6 Java Development Kit (JDK) - Enter the below command on CentOS command line.

$ sudo yum install java-1.6.0-openjdk-deve1



Verify Installed Java Version on CentOS


Once the OpenJDK 6 installation is complete, we can verify the installed OpenJDK 6 version using below Command.



On Centos, Go to prompt and type java -version
The above command prints the OpenJDK 6 version you installed.

Java -version


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


Congratulations !!! Now you have installed OpenJDK 6 on CentOS 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





x