Installing Java on macOS
The Minecraft Launcher ships its own bundled Java runtime, so most players never need to install Java separately. You only need a system-wide Java install when the OptiFine .jar installer refuses to open, when you launch Minecraft through a third-party launcher, or when you run java -jar from a terminal.
Choose your OS
Which version of Java?
Modern Minecraft (1.18 and newer) needs Java 17 or later. Minecraft 1.21 and newer targets Java 21. For legacy Minecraft versions (1.16 and older), Java 8 is the safe choice. Both Eclipse Temurin and Amazon Corretto are free, well-tested distributions.
1. Download the installer
Get the .pkg installer for your Mac from Eclipse Temurin. Pick aarch64 for Apple Silicon (M1/M2/M3) or x64 for older Intel Macs.
2. Run the installer
Double-click the .pkg and follow the prompts. macOS may ask you to confirm the developer in System Settings → Privacy & Security.
3. Install via Homebrew (optional)
If you use Homebrew, this is a one-liner:
brew install --cask temurinVerify the install
Open a new terminal or command prompt and run:
java -versionYou should see a version string like openjdk version "21.0.4". If the command isn't found, the runtime isn't on your PATH — reopen your terminal or re-run the installer.