Search code examples
javahomebrewhomebrew-cask

How to upgrade to latest version of java JDK using homebrew cask?


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?


Solution

  • By default, Homebrew does not uninstall old versions of a formula, so over time you will accumulate old versions.

    The cleanup - brew cleanup command will remove outdated installed package versions.