modify installJava function