Clean up bash script

Check for JAVA_HOME in 2 places, if it’s not found then exit with an
error. This supports Debian/Ubuntu and RHEL/Centos