brew update
brew install jenv
brew tap caskroom/cask
brew tap caskroom/versions
mkdir ~/.jenv/versions
# Already in: https://github.com/branneman/dotfiles/blob/f2002f4/.profile#L41-L42
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.profile
echo 'eval "$(jenv init -)"' >> ~/.profile
Restart your terminal when you're done.
Download & Install all the different Java versions you like, then print all found Java versions:
/usr/libexec/java_home -V
Add them to jenv:
jenv add /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
jenv add /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
jenv versions
jenv global oracle64-1.8.0.144