CPSC/DTSC 115L: Introduction to Computer Science Fall 2026

Installing Java on macOS and Windows

This quick guide is designed for those who wish to install and use Java on macOS or Windows at their own risk. In this course, we will be using Java Platform, Standard Edition (Java SE) 21 (in particular, the laboratory workstations currently run Java 21.0.12).

1. macOS

The following apply to both Apple-silicon- and Intel-based Macs running macOS 12 (Monterey) or later. Most Macs today have Apple silicon (ARM64) processors. Older Macs, say, from 2021 or earlier, are likely to have Intel (x64) processors. If you are not sure whether your Mac has an ARM64 or x64 processor, read this page. For more details on installation, read this guide.
  1. To install the version of Java SE 21 for Apple silicon (ARM64) processors, run the installer for Java SE Development Kit 21.0.12.1 for ARM64 from:
    https://download.oracle.com/java/21/latest/jdk-21_macos-aarch64_bin.dmg
    
    To install the version of Java SE 21 for Intel (x64) processors, run the installer for Java SE Development Kit 21.0.12.1 for x64 from:
    https://download.oracle.com/java/21/latest/jdk-21_macos-x64_bin.dmg
    
  2. To invoke the command-line-based Java compiler and interpreter, simply type “javac” and “java”, respectively, in a Terminal window.

2. Windows

The following apply to x64-based PCs running 64-bit versions of Windows 11 or later. For more details on installation, read this guide.
  1. To install the version of Java SE 21 for 64-bit Windows, run the installer for Java SE Development Kit 21.0.12.1 for x64 from:
    https://download.oracle.com/java/21/latest/jdk-21_windows-x64_bin.exe
    
    Note the installation directory, which is something like this:
    C:\Program Files\Java\jdk-21.0.12
    
  2. Next, add the installation directory path, for example,
    C:\Program Files\Java\jdk-21.0.12\bin;
    
    to the beginning of your PATH environment variable.

  3. To invoke the command-line-based Java compiler and interpreter, simply type “javac” and “java”, respectively, in a Command Prompt window.


* CPSC/DTSC 115L home page
Valid HTML 4.01!