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
I'd like to see you check if $JAVA_DIR/../../bin/java exists, then use that JAVA_HOME, else check if $JAVA_DIR/../bin/java exists and then use that, else error & exit.