Fix java home directory bug