Setting Java Home in Ubuntu 20
1.Open Terminal Using the command ctr+alt+T
2.Type the Command 'sudo -H gedit /etc/profile'
3.Separate Window Opens up there add the following
JAVA_HOME=/opt/java/jre1.8.0_281/bin
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
4.In JAVA_HOME point it to the directory where you have extracted the Java.Save it and close the window.
5.Logout and Login again now test the java home using the echo $JAVA_HOME
Happy Learning.!!!!