If you are new to java and mac then this blog will be helpful for you to start with install java in mac.
Step 1: Download Java from its official website, open the below URL.
https://java.com/en/download/

Step 2: Click on “Java download” button

Step 3: Click on “Agree and start free download” button

Step 4: Save the file in the hard disk and double click on the downloaded file. It will ask you to agree and install. Click on the install button.

Congratulation! You have successfully installed java in your mac. In case you face any issue, feel free to write in the below comment box.

Happy Coding !!