avatarErwin Schleier

Summary

The website provides a guide for installing JDK 8 and setting up the JAVA_HOME environment variable on a Mac M1.

Abstract

The provided content is a step-by-step tutorial aimed at developers using the new Mac Book Pro with an M1 chip, detailing the process of installing Java Development Kit (JDK) version 8. It emphasizes the challenges faced due to the new architecture and outlines the necessary steps, including installing Homebrew, setting up Rosetta 2, using Homebrew to install Java, and finally setting the JAVA_HOME path permanently in macOS. The guide also includes commands for adding Homebrew to the PATH and sourcing the shell configuration file to activate changes.

Opinions

  • The author expresses that Macs are an excellent choice for developers, particularly highlighting the new Mac Book Pro with an M1 chip.
  • There is an acknowledgment that the transition to new hardware like the M1 chip comes with setup challenges, implying that the process is not straightforward.
  • The guide suggests that installing JDK 8, in particular, is one of these challenges, indicating a potential lack of native support or ease of installation for this specific JDK version on M1 Macs.
  • The author's choice to use Homebrew for package management suggests a preference or recommendation for this tool in the Mac ecosystem.
  • By providing a link to Azul's website for downloading the JDK, the author seems to endorse Azul's JDK distribution as a reliable source for JDK 8 on M1 Macs.

Install JDK 8 and Setup JAVA_HOME on Mac M1

Macs are awesome! For developers there is no better alternative on my opinion right now. So I got a new Mac Book Pro with a M1 chip. Despite it’s beauty there are some setup challenges. One of them is installing JDK8. To make the transition easy, the following guides you through the installation process.

Homebrew Setup

As a pre requisition homebrew has to be installed.

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

Add Homebrew to your PATH

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/vishal/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)"

Test if Homebrew is in your PATH

Install JAVA

Next of course, you have to install Java if not already done.

Install Rosetta 2

sudo softwareupdate --install-rosetta

Install Java using Homebrew

brew tap adoptopenjdk/openjdk && brew install --cask adoptopenjdk8

Install OpenJDK8

And finally you can install JDK8. Therefore go to: https://www.azul.com/downloads/?version=java-8-lts&os=macos&architecture=arm-64-bit&package=jdk scroll down and download the .dmg file than execute it.

Set JAVA_HOME path permanently in macOS

and add it to the path

export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home

save and close the file (Control + X). Than activate the changes.

source ~/.zshrc

Originally published at https://erwin-schleier.com.

Mac
Java
Config
Development
Recommended from ReadMedium