Other applications make use of the JAVA_HOME environment variable as configured/set in the ~/.bashrc, /etc/environment, /etc/profile, ~/.profile, or /etc/profile.d (directory with scripts) as shown below.
In most (possibly all) RPM/RHEL-based distros the alternatives command can be used to check and/or set the Java version used by most applications as demonstrated below. Typically, the version numbers are identified with the directory names. Usually, Oracle JDK is installed to /usr/java and Open JDK is installed to /usr/lib/jvm.