remove JAVA_HOME dependency and allow run foreground