
Set JAVA_HOME path permanently in macOS nano ~/.zshrcĪnd add it to the path export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/HomeĮxport JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8. Install Rosetta 2 sudo softwareupdate -install-rosetta Install Java using Homebrew brew tap adoptopenjdk/openjdkīrew install -cask adoptopenjdk8 Install OpenJDK8Īnd finally you can install JDK8.
%20and%20Get%20Started%20with%20Java%20Programming_files/MacJavaCompile.png)
Next of course, you have to install Java if not already done. Test if Homebrew is in your PATH echo $PATH Install JAVA bin/bash -c “$(curl -fsSL )”Īdd Homebrew to your PATH echo ‘eval “$(/opt/homebrew/bin/brew shellenv)”’ > /Users/vishal/.zprofileĮval “$(/opt/homebrew/bin/brew shellenv)” There are two different implementations of JDK OpenJDK and Oracle JDK. To run and develop an application in Java, you need to install the Java Development Kit (JDK). Homebrew SetupĪs a pre requisition homebrew has to be installed. Java is a popular object-oriented programming language used for building applications. To make the transition easy, the following guides you through the installation process. Despite it’s beauty there are some setup challenges. Now to add Java 8 as your overall global java version, run the following command: jenv global openjdk64-1.8.0. We can visit the official website of oracle by simply pasting the link in the browsers search. So I got a new Mac Book Pro with a M1 chip. There are the following steps used to install Java on MacOS.

Macs are awesome! For developers there is no better alternative on my opinion right now.
