index

Download JDK 8:

https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html

I downloaded: jdk-8u202-linux-x64.tar.gz

Enter below:

cd ~/

mkdir java

cd java

tar -xvzf jdk-8u202-linux-x64.tar.gz

cd jdk1.8.0_202

pwd

/home/bigdata2/java/jdk1.8.0_202

This is JAVA_HOME, in my example, JAVA_HOME=/home/bigdata2/java/jdk1.8.0_202

vi ~/.bashrc, append following in the end of file ~/.bashrc, in my JAVA_HOME:

export JAVA_HOME= =/home/bigdata2/java/jdk1.8.0_202

export PATH=$JAVA_HOME/bin:$PATH

Save and exit vi

Run

source ~/.bashrc or log out and log back in.

Now run to confirm

java –version

javac -version

Last updated