fix the path and export JAVA_HOME only if java is installed