Java function to setup java version