How to Install Java 8 on CentOS 7

Java is most common requirement for many of the Open Source softwares. You can follow below steps to install Java on CentOS vm.

You can first check the list of available packages for Java using below command.

$ yum search java | grep 'java-'


You will get the list like above. Now depending on what is your requirement you can choose the package. If you don't see any list as above, you will need to update the REPO for java.

To install JRE you can run below command.


$ sudo yum install java-1.8.0-openjdk.x86_64

To install JDK you can use below command.

$ sudo yum install java-1.8.0-openjdk*

The above commands will ask for downloading the required dependencies, press Y and enter to continue with installation. Once installation completes it will display the dependencies installed and complete message.

Now you can verify the installation by running below command.

$ java -version
openjdk version "1.8.0_144"
OpenJDK Runtime Environment (build 1.8.0_144-b01)
OpenJDK 64-Bit Server VM (build 25.144-b01, mixed mode) 

You should see the java version as shown in above output.

No comments:

Post a Comment

Golang: Http POST Request with JSON Body example

Go standard library comes with "net/http" package which has excellent support for HTTP Client and Server.   In order to post JSON ...