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