Homebrew is a package manager that makes it easy for us to install all sorts of development tools such as MySQL, Mongo, Ruby on Rails, and Java. Below are the steps required to install Java using Homebrew.
Homebrew does not come pre-installed with Mac, so you'll have to install it yourself. Thankfully, it's a single line of code that you paste into the terminal. Here are instructions on how to install Homebrew on Mac.
java was migrated from
Multiple installations. Create a Homebrew installation wherever you extract the tarball. Whichever brew command is called is where the packages will be installed. You can use this as you see fit, e.g. A system set of libs in the default prefix and tweaked formulae for development in /homebrew. Installing Homebrew on Mac OS X prior to El Capitan (that is Yosemite, Mavericks and others) used to be a breeze. But with a new change in OS X El Capitan called SIP - installing Homebrew has become a bit complicated.
This approach will
Some projects require an older version of JDK (such as Java 8). The best thing to do is install AdoptOpenJDK.
Install Java 8
Install Java 12
brew keeps erroring out for no reason, I suggest running this command.