Download and Install JDK on macOS

This section provides a tutorial example on how to download and install the latest version JDK, which contains the HotSpot JVM, on a macOS system. A simple Java program was entered, compiled, and executed to verify the JDK installation.

In order try the HotSpot JVM, I downloaded and installed JDK 20 (Java SE 20) on my macOS system:

1. Go to Oracle Java SE download website at

2. Click "JDK 20 > macOS" tab.

3. Click on the "jdk-20_macos-x64_bin.dmg" link in the "x64 DMG Installer" line to download the installation file to your "Downloads" directory.

4. Double-click on the "jdk-20_macos-x64_bin.dmg" file to install it.

To test the installation, open a command window to try the java command.

herong$ java -version
java version "20.0.1" 2023-04-18
Java(TM) SE Runtime Environment (build 20.0.1+9-29)
Java HotSpot(TM) 64-Bit Server VM (build 20.0.1+9-29, mixed mode, sharing)

Cool, I have successfully installed JDK 20 on my macOS computer!

Table of Contents

 About This Book

 JVM (Java Virtual Machine) Specification

Java HotSpot VM - JVM by Oracle/Sun

 What Is HotSpot JVM

Download and Install JDK on macOS

 Download and Install JDK on Windows

 Running Java HotSpot Client VM

 Running Java HotSpot Server VM

 HotSpot Memory Usages on Windows Systems

 java.lang.Runtime Class - The JVM Instance

 java.lang.System Class - The Operating System

 ClassLoader Class - Class Loaders

 Class Class - Class Reflections

 JVM Runtime Data Areas

 JVM Stack, Frame and Stack Overflow

 Thread Testing Program and Result

 CPU Impact of Multi-Thread Applications

 I/O Impact of Multi-Thread Applications

 CDS (Class Data Sharing)

 Micro Benchmark Runner and JVM Options

 Micro Benchmark Tests on "int" Operations

 Micro Benchmark Tests on "long" Operations

 Micro Benchmark Tests in JIT Compilation Mode

 Micro Benchmark Tests on "float" and "double" Operations

 OpenJ9 by Eclipse Foundation

 JRockit JVM 28.2.7 by Oracle Corporation

 Archived Tutorials


 Full Version in PDF/EPUB