How to Install Java on CentOS
Java is the most popular, general purpose, object-oriented, secured, robust, portable programming language which was developed by Sun Microsystems in 1995. Its development was started by James Gosling, Mike Sheridan and Patrick Naughton. Java follows "Write Once Run Anywhere" paradigm which means a Java code need not to be compiled again and again on various machines. Latest version of Java is Java 9 which is released on September 21, 2017. In this tutorial, we will learn the installation process of java on CentOS.
1) Update the local repository index of Yum
Use the following command to update the local repository index of yum.
2) Check Java
Use the following command to check whether java is already installed on the system or not.
3) Download JDK8
Visit http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and download the rpm package of jdk8 for CentOS7 64 bit.
4) Install Java
Use the following command to install Java.
5) Verify Java
Type javac on the terminal to verify, if Java installed on our CentOS. It gives the response like following.
Hence, we have successfully installed Java on CentOS.