Java
Download and install java
sudo yum install java-11
Use Alternatives to change your default version
sudo alternatives --config java - then select the number
update version using update-alternate
sudo update-alternatives --config java
Check java version
java -version
Change java home directory
there are multiple ways try one of the following and user which one works for you
sudo vi ~/.bashrc
sudo vi ~/.bash_profile
sudo vi /etc/profile
sudo vi /etc/profile.d/java.sh
update or add the following values
export JAVA_HOME="path of you java"
export PATH=$JAVA_HOME/bin:$PATH
try echo $JAVA_HOME and make sure it is showing the current version