Install Java in macbook M1/M2/M3

khairunnaharnowrin

Khairun Nahar Nowrin

Posted on May 3, 2024

Install Java in macbook M1/M2/M3

Install Homebrew: If you haven't already installed Homebrew, you can do so by opening Terminal and running the following command:
bash

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Enter fullscreen mode Exit fullscreen mode

==> Next steps:

  • Run these two commands in your terminal to add Homebrew to your PATH:
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/user_name/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
Enter fullscreen mode Exit fullscreen mode

Install JDK using Homebrew: Once Homebrew is installed, you can install the JDK for ARM-based Macs by running the following command:
bash

brew install --cask temurin
Enter fullscreen mode Exit fullscreen mode

This will install the Temurin JDK, which is compatible with ARM-based Macs.
Verify Installation: After installation, you can verify that Java is installed by running:
bash

java -version
Enter fullscreen mode Exit fullscreen mode

This command should display the version of Java installed on your system.

💖 💪 🙅 🚩
khairunnaharnowrin
Khairun Nahar Nowrin

Posted on May 3, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related