Install JDK on Linux

How to Install JDK on Linux platform

In this article, I’m going to show you how to install JDK on Redhat Linux step by step. Firstly we need to download JDK rpm for your supported platform just click here.

Install JDK rpm

After downloading a JDK we need to install it using the following command with the root user.

#rmp -ivh jre-8u201-linux-i586.rpm

Check JDK version

Once JDK installation is completed, check the version of installed jdk using following command.

#java -version

Find JDK home location

Now check the java home address.

# /usr/sbin/alternatives --config java

There are 2 programs which provide 'java'.

Selection Command
-----------------------------------------------
1 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
*+ 2 /usr/java/jre1.8.0_201-i586/bin/java

Enter to keep the current selection[+], or type selection number: 2

Check java compiler.

# /usr/sbin/alternatives --config javac

There is 1 program that provides 'javac'.

Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/javac

Enter to keep the current selection[+], or type selection number: 1

Now export java home and use it.

#export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk.x86_64

Java Home

Check Java_home is exported or not.

# echo $JAVA_HOME
/usr/lib/jvm/java-1.6.0-openjdk.x86_64

Read – How to Use GIF file in Android Studio

Connect with me on:

Instagram: https://www.instagram.com/shripaldba
Linkedin: 
https://www.linkedin.com/in/shripal-singh
Twitter: 
https://twitter.com/ocptechnology
Facebook: 
https://www.facebook.com/ocptechnology
YouTube:
https://www.youtube.com/ocptechnology

1 thought on “Install JDK on Linux”

Leave a Comment

%d bloggers like this: