Step 1: find current java version
$ jave -version
$ rpm -qa | grep java
$ rpm -qa | grep jdk
Step 2: remove the package
$ rpm -e --nodeps java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64
$ rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.292.b10-1.el7_9.x86_64
Step 3: check if removal is successful
$ java -version
Step 4: install new version
$ sudo yum install java-11-openjdk