Friday, 1 October 2021

How to Install Java JDK on MacOS with JAVA_HOME Step by Step installation

Download Java SDK on Mac

Open Terminal -) java -version

Serach for oracle java sdk

open the first link

choose JDK download

select macOS installer 

Download the JDK .dmg file here:

Install the SDK for Mac

  • Double click the .dmg file.
  • Double click the package icon to launch the Install app.
  • Click Continue.
  • Click Install.
  • Enter the administrator user name and password and click Install Software.
  • After the software is installed, delete the .dmg file so that you can save disk space.

If The .zshrc file is not present by default in macOS Catalina, So you may need to create it. Additionally you can also use ~/. bash_profile or ~/.profile if they are present to store your java variable

Steps for creation:

  1. Open Terminal
  2. Type touch ~/.zshrc to create the respective file. (touch command will create the .zshrc in your current directory but it will be hidden)
  3. Hit Return

To view/open ~/.zshrc you can do either of two things:

  1. Open Finder -) Press Cmd+Shift+.


  1. I will use Open Terminal -) and type: open ~/.zshrc

- If using bash_profile use: open ~/. bash_profile

- If using .profile  use: open ~/.profile 

export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home"

source ~/.zshrc

No comments:

Post a Comment

Interview Experience with AMAZON for the role of Quality Assurance Tester

This role was for Digital/ IoT/Mobile Application based testing :)  Amazon is a dream company and everyone wants to work for that company a...

Popular Posts