Add to /etc/profile.local:
export JAVA_HOME=/usr/java/latest
export JAVA_HOME
to /etc/profile.local.
That way it will be set for all users and will be independent of the release or patch-number. /usr/java/latest/usr/java/latest is a link to the latest installed version and exists since JDK/JRE 1.6