Fix JAVA_HOME SCRIPT to support more linux distros

Add if else clause.

If the bin/java directory exists in a specific location, we know that
it is debian/ubuntu. Otherwise, it is rehl/centos
Please print an error message then exit (same for other scripts)