This document deals with how to setup OpenJDK 11
OpenJDK is a free and open-source implementation of the Java Platform, Standard Edition. It is the result of an effort Sun Microsystems began in 2006. The implementation is licensed under the GNU General Public License version 2 with a linking exception

Installation

 

yum install wget

Download OpenJDK 11

wget https://download.java.net/java/GA/jdk11/28/GPL/openjdk-11+28_linux-x64_bin.tar.gz -O /tmp/openjdk-11+28_linux-x64_bin.tar.gz

Extract the OpenJDK 11

cd /tmp
tar -xvzf openjdk-11+28_linux-x64_bin.tar.gz
mkdir /usr/java
mv jdk-11 /usr/java

Create a profile file to load the java path

 

vi /etc/profile.d/java.sh
export PATH=/usr/java/jdk-11/bin:$PATH
export JAVA_HOME=/usr/java/jdk-11

Enable the Java profile.

source /etc/profile.d/java.sh

Check the java version


java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

Now java will be available for each and every user. if you want java to be available for a specific user, then add java.sh entry in .bashrc of each user.

© 2018, Techrunnr. All rights reserved.

#1
#2
#3
Questions Answered
Articles Written
Overall Points
Categories: Linuxubuntu

Prabhin Prabharkaran

He is Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!!

Leave a Reply

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.