add function to change java version