Home » How to Install Java on CentOS

How to Install Java on CentOS

by Online Tutorials Library

How to Install Java on CentOS

Introduction

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.

Prerequisites

  • CentOS 7
  • Login as an administrator on the terminal.
  • Yum must be configured on the system.

Installation

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.

CentOS How to Install Java on CentOS 1

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.

CentOS How to Install Java on CentOS 2
CentOS How to Install Java on CentOS 3

5) Verify Java

Type javac on the terminal to verify, if Java installed on our CentOS. It gives the response like following.

CentOS How to Install Java on CentOS 4

Hence, we have successfully installed Java on CentOS.

Next TopicInstall Ruby

You may also like