Here is how you quickly install (or upgrade) the latest OpenJDK on a Unix-based OS (my OS: RedHat 8.2):

$ sudo yum install java-11-openjdk-devel

We all know the most of the IAM products need Java/JDK to run. For this reason, it is important to set up the so called JAVA_HOME global variable and set it in the path. Here is how you set it and make it available for all the Linux users:

Step 1: Check where is located your installed Java/JDK

$ which java
/usr/bin/java

$ ls -la /usr/bin/java
lrwxrwxrwx. 1 root root 22 Aug 13 13:07 /usr/bin/java -> /etc/alternatives/java

$ ls -la /etc/alternatives/java
lrwxrwxrwx. 1 root root 62 Aug 13 13:07 /etc/alternatives/java -> /usr/lib/jvm/java-11-openjdk-11.0.8.10-0.el8_2.x86_64/bin/java

Step 2: Update /etc/profile and reload it

$ sudo vi /etc/profile

# set JAVA_HOME variable

export JAVA_HOME=’/usr/lib/jvm/java-11-openjdk-11.0.8.10-0.el8_2.x86_64′

export PATH=’$JAVA_HOME/bin:$PATH’

$ source /etc/profile

Step 3: Check JAVA_HOME variable

$ echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-11.0.8.10-0.el8_2.x86_64

$ echo $PATH
/usr/lib/jvm/java-11-openjdk-11.0.8.10-0.el8_2.x86_64/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin$ echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-11.0.8.10-0.el8_2.x86_64

$ $JAVA_HOME/bin/java -version
openjdk version “11.0.8” 2020-07-14 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.8+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode, sharing)

$ java -version
openjdk version “11.0.8” 2020-07-14 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.8+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode, sharing)

That’s all!

Comments

Your email address will not be published. Required fields are marked *

TRIVETI BV