Skip to content

Java

Before beginning to program in Java, you will require the Java Development Kit (JDK) to be installed first. As of writing this guide, the current LTE JDK version is JDK 25. (I will try to update this page as and when needed, but doing a simple web search online should do the trick.)

Why use LTS?

LTS stands for long-term support. Specifically, when a distributed software is labeled as LTS, it means that they get more than the standard support expected from all regularly maintained software.

JDK 25 was released on 16 September 2025, which is quite recent to be frank.. but there will soon be a JDK 26 releasing on March 17, 2026. Typically, each JDK version will be deemed obsolete once the next version is released, but since JDK 25 is an LTS version, it will continue to receive support for an extended period of time. This is not the same for JDK 26, or JDK 24 which was released before that.

Additionally, each new version will introduce just a couple of improvements which may or may not be significant to you (especially for beginner learners). Still having additional support (like security support) and having not need to upgrade every 6 months gives a peace of mind many would sought after. There is also JDK 21 (released 19 September 2023), but it will be obsolete only in 2029.. this will give an idea on how long an LTS version is maintained for. (While it's not wrong to use JDK 21, if you're installing it for the first time, it's best to just get JDK 25 right off the bat.)

You can have a look at the compilation of all the released Java JDK versions in this Wikipedia page here.

TL;DR: Just use the LTS version. It can apply to other types of software you'll encounter in the future (e.g., Ubuntu LTS).

I recommend installing the Amazon Corretto JDK, but installing it from Oracle would be fine as well. Ultimately it does not really matter; from my understanding it boils down to which party is maintaining the JDK LTS distributions. Honestly, I may have been swayed to follow Tim Buchalka's preference. You can go check out some very outdated JDK 11 guides on how to install them here (but the steps should more or less be the same):

Downloading Amazon Corretto JDK

The link to download the Amazon Corretto JDK is right here.

Amazon Corretto Website

Click on Download Corretto 25. You should see a table chock full of donwload links to obtain the JDK. Scroll down on the table until you see your operating system (some flavor of Linux, or Windows x64 or macOS x64). For Windows and macOS, just select the .msi and .pkg installer respectively.

From here, just follow the instructions on the installer. By then, you should have successfully installed the JDK in your machine.

Homebrew (for macOS)

This is my preferred method of installing almost everything I need on my macOS machine. If you have not installed Homebrew on your macOS machine yet, paste and run this command in the Terminal:

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

Or, if this does not work.. it's best to visit the website itself for up-to-date instructions: Homebrew website here

This first step is optional, but recommended if you do not know what to look for. You can search up any cask or package by typing in the command: brew search <package/cask>

brew search corretto

You should see something like as follows:

Searching for Corretto in Homebrew

As of typing out this guide, only LTS versions of Amazon Coretto JDK are included: corretto@25, corretto@21, corretto@17, corretto@11, corretto@8. There is also corretto, but in case there comes a time where you're tied up on a project that can only work with a specific version of JDK, we'll be specific and install corretto@25.

Install JDK 25 using the command: brew install <package>. (For casks, it's brew install --cask <cask>. But that's not what we should use here since JDK is not kept as a cask, i.e., JDK is not a full-blown app.)

brew install corretto@25

In Homebrew, you should also be able to install other JDK distributions like microsoft-openjdk@25, oracle-jdk@25 and openjdk@25. Quickly typing in brew search jdk will give you the full list of JDKs you can download from Homebrew.

Verify JDK Installation

To check if you have downloaded JDK successfully, you can type in the following in the terminal:

java --version

You should see something like as follows:

Checking for Java version

openjdk 25.0.1 2025-10-21 LTS
OpenJDK Runtime Environment Corretto-25.0.1.8.1 (build 25.0.1+8-LTS)
OpenJDK 64-Bit Server VM Corretto-25.0.1.8.1 (build 25.0.1+8-LTS, mixed mode, sharing)