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

Viewed 13784

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?

4 Answers

Warning: Calling brew cask reinstall is deprecated! Use brew reinstall instead

brew reinstall java

To upgrade the sub-version of java i.e from 11.0.8,10 to 11.0.9.1,1, use the following command.

brew upgrade --cask adoptopenjdk11
Related