zsh: add check before exporting JAVA_HOME