Create/edit /etc/sysconfig/openfire and add there as the last line
JAVA_HOME=/path-to-java
/path-to-java/bin/java should be the RHEL java version.
Create/edit /etc/sysconfig/openfire and add there as the last line
JAVA_HOME=/path-to-java
/path-to-java/bin/java should be the RHEL java version.