GETTING UBUNTU v20.04 to Recognize / Utilize Oracle JAVA v8
After download and install to this directory "/usr/lib/jvm/jre1.8.0_301/", as mentioned above,I believe this works ... hope it helps someone else!
Code:
~$ sudo scite /etc/environment
## MODIFY FILE / ADD FOLLOWING VARIABLES
JAVA_HOME="/usr/lib/jvm/jre1.8.0_301"
## CLOSE SCITE & VERIFY
~$ echo $JAVA_HOME
## UPDATE PROFILE
~$ sudo scite /etc/profile
## MODIFY FILE / ADD THE FOLLOWING
JAVA_HOME=usr/lib/jvm/jre1.8.0_301
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export PATH
## SAVE FILE & CLOSE SCITE (NANO, etc.)
~$ sudo apt update
~$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jre1.8.0_301/bin/java" "1000"
~$ java -version
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
~$ sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
* 1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
3 /usr/lib/jvm/jre1.8.0_301/bin/java 1000 manual mode
Press <enter> to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/lib/jvm/jre1.8.0_301/bin/java to provide /usr/bin/java (java) in manual mode
~$ java -version
java version "1.8.0_301"
Java(TM) SE Runtime Environment (build 1.8.0_301-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.301-b09, mixed mode)
~$ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jre1.8.0_301/bin/javaws" "1000"
~$ sudo update-alternatives --config javaws
There are 2 choices for the alternative javaws (providing /usr/bin/javaws).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/icedtea-web/bin/javaws 1101 auto mode
1 /usr/lib/icedtea-web/bin/javaws 1101 manual mode
2 /usr/lib/jvm/jre1.8.0_301/bin/javaws 1000 manual mode
Press <enter> to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/jre1.8.0_301/bin/javaws to provide /usr/bin/javaws (javaws) in manual mode
Bookmarks