Take a look at the comments and code in update.sh.
$ source update.sh
I use update-usr-local.sh after a successful build to copy the new JVM into /usr/local.
I add pickjdk.sh into my ~/.bash_profile to allow easy switching between multiple JVMs.