add platform check before export JAVA_HOME