Fixed bug on java home safeguard