Rollback to JAVA_HOME path and added a function to change the version of java