I have been following these instructions to install the latest java jdk:
www.lonecpluspluscoder.com/2017/04/27/installing-java-8-jdk-os-x-using-homebrew/
brew cask install java
This works great, but when a new version comes out, how do I make sure I can upgrade to that version and ensure that old versions of the jdk are not sitting around on my system?