Managing Multiple Java Versions on Mac
I've recently seen a lot of folks struggling with this, so I figured I would document the approach I'm using. Firstly, the best way to install most programs on the Mac is obviously Homebrew . However, whereas Homebrew works fine to install OpenJDK versions of Java, the Oracle versions are not available on Homebrew (or any of the Casks) as I write this post. So, you will need to download the installer from Oracle's website (requires registration). Make sure you pay attention to whether you need the JRE (Java Runtime Environment) or JDK (Java Development Kit). The JRE is sufficient if all you need to do is run a Java application or another application that runs on the Java VM. The JDK is needed if you need to compile or build Java programs. JREs and JDKs are designed to allow multiple versions to co-exist peacefully on the same machine. If the installer asks you to uninstall an older version, that's usually a recommendation aimed at preventing you from continu