How to install java on macbook

Miftahul Alim
Aug 18, 2023

--

In this article, I will provide the steps to install Java on your device, These are the steps to install Java on your device. here we go !

  1. Download JDK file from https://jdk.java.net
  2. Extract the JDK file that was downloaded earlier

3. After extracting, add JDK Path to Zsh Configuration

open terminal, and open your zsh configuration

nano ~/.zshrc

after this, lets add your jdk directory path into .zshrc

export JAVA_HOME="$HOME/YourdirectoryPath/jdk-20.0.2.jdk/Contents/Home"
export PATH="$JAVA_HOME/bin:$PATH"

and then apply changes into your terminal

source ~/.zshrc

4. The final step, lets check if the java has already installed correctly

finally you already installed java on your macbook😉

--

--