Bash: check for java existence before setting JAVA_HOME