Wednesday, March 31, 2021

How to install JDK on linux

 Login to the server

wget https://files-cdn.liferay.com/mirrors/download.oracle.com/otn-pub/java/jdk/8u121-b13/jdk-8u121-linux-x64.rpm

rpm -ivh jdk-8u121-linux-x64.rpm

java -version

vi /etc/profile.d/java.sh

#!/bin/bash

JAVA_HOME=/usr/java/jdk1.8.0_121/

PATH=$JAVA_HOME/bin:$PATH

export PATH JAVA_HOME

export CLASSPATH=.


chmod +x /etc/profile.d/java.sh

source /etc/profile.d/java.sh

java -version

No comments:

Post a Comment