Java

There is no AI here. All content is human-authored and tested for accuracy.

Java Latest Version

Java 25 is the latest Java version for macOS though Java 21 remains widely used. Compare versions, find a JDK, and install the right Java version on your Mac.

Java 25 is the latest version of Java, released on September 16, 2025 as a Long-Term Support (LTS) release. Java follows a predictable six-month release schedule with new LTS versions every two years. This newest LTS offers guaranteed updates through September 2033. See my article Update Java on Mac for help upgrading your installed Java version or Install Java 25 on Mac if you don't have Java installed yet.

Java 24 (released March 2025) is the most recent non-LTS feature release, but most developers will skip it and go straight to Java 25 LTS. Feature releases receive updates for only six months, while LTS releases get security patches and bug fixes for years. For new projects on Mac, Java 25 LTS is the recommended version.

Java 21 (released September 2023) was the most recent LTS version before Java 25. The Java 21 version is still widely used. See Compare Java 21 to Java 25 for a detailed comparison between the two newest LTS versions. You may need it for work on existing projects if the codebase hasn't been updated to Java 25. See Install Java 21 on Mac.

See Check Java Version on Mac to find out what version is available on your Mac. My Java on Mac article provides a broad overview.

Before you get started

You'll need a terminal application to develop with Java on Mac. Apple includes the Mac terminal but I prefer Warp Terminal. Warp is an easy-to-use terminal application, with AI assistance to help you learn and remember terminal commands. Download Warp Terminal now; it's FREE and makes coding easier when working with Java.

How to install the latest Java version

If you don't have Java installed, here are articles to help install the latest version:

  1. Check Java Version on Mac — see what's already installed
  2. Install Java on Mac — a recommended installation method plus alternatives
  3. Set JAVA_HOME on Mac — configure environment variables for build tools

The easiest way to install Java 25 is with Homebrew: brew install --cask temurin@25. This installs Eclipse Temurin, the Java distribution most developers prefer. Homebrew handles architecture detection automatically, so you get native Apple Silicon builds on M-series Macs. Read Brew Install Java - Easy Cask Method for detailed Homebrew installation nstructions.

Java 25 improvements

Java 25 finalizes several long-awaited features after multiple preview rounds. The most notable addition is compact source files, which means you can now write a simpler void main() { } instead of the traditional public static void main(String[] args) { } boilerplate. This will become the most obvious way to tell Java 25 code from earlier versions.

Java 25 also introduces flexible constructor bodies (statements before super() calls), scoped values for virtual threads, and module import declarations.

Performance improvements include compact object headers (reducing memory overhead per object), generational Shenandoah garbage collection, and ahead-of-time method profiling for faster startup. These optimizations benefit all Java applications without requiring code changes.

Which Java version should you use?

The right Java version depends on your situation. Here's how to decide.

For students: Check your course requirements

Install the Java version your professor or course syllabus specifies. This is often Java 21 or an older LTS version. Check your syllabus or ask your instructors before installing Java. Using a different version than assigned can cause compatibility issues with course materials, grading scripts, and lab exercises. Read Install Java 21 on Mac if your course requires Java 21.

For teams with existing projects: Match the project Java version

Your project may specify Java 21, 17, 11, or even Java 8. Use what the project requires. If you're joining a software engineering team or working on an existing codebase, check your project's build configuration (pom.xml for Maven, build.gradle for Gradle) or ask your team lead. Wait for your team to complete the migration before upgrading to Java 25. Updating the Java version affects the entire codebase and CI/CD pipeline. You may need to use Java Version Managers to switch among multiple versions

For new projects: Use Java 25 LTS

If you're starting a new project, use Java 25. It's the newest LTS release with the longest support window. Java 25 gives you access to the newest language features, best performance, and the longest runway before your next required upgrade. For greenfield development, Java 25 is the recommended Java version. Spring Boot 4.0 and Spring Framework 7.x work best with Java 25. Quarkus 3.x and Micronaut 4.x also provide full support. Read Install Java 25 on Mac for installation instructions.

Current LTS versions

Here are the supported LTS versions and their support timelines:

  • Java 25 LTS – Released September 2025, support until September 2033
  • Java 21 LTS – Released September 2023, support until September 2031
  • Java 17 LTS – Released September 2021, support until September 2029
  • Java 11 LTS – Released September 2018, support until September 2026
  • Java 8 LTS – Released March 2014, support until December 2030

Java 17, Java 11, and Java 8 remain in use for legacy projects and enterprise support contracts. Some libraries and frameworks have version requirements that lock you into specific releases.

Java release schedule

Oracle releases new Java versions every six months in March and September. This release cadence means you always know when the next version arrives. Feature releases (non-LTS) receive updates for six months until the next version. LTS releases receive updates for years.

The two-year LTS cadence means a new long-term support version appears every other September. Java 25 LTS arrived in September 2025. The next LTS release, Java 29, is planned for September 2027.

Understanding release types

Long-Term Support (LTS) releases receive security updates, bug fixes, and critical patch updates for years. Oracle provides free updates for the first three years, followed by commercial support options. Eclipse Temurin and other community distributions extend free support even longer.

Feature releases (non-LTS) deliver new capabilities every six months but receive updates only until the next version ships. Skip these for production unless you need a specific preview feature.

Quarterly updates arrive in January, April, July, and October with security patches and bug fixes. These Critical Patch Updates keep your installation current between major releases.

See Update Java on Mac for upgrade help.

Java distributions: Which one to choose?

All major Java distributions build from the same OpenJDK source code. The differences come down to licensing, support options, and minor packaging details. For most developers, Eclipse Temurin is the best choice.

Eclipse Temurin (recommended)

Eclipse Temurin from the Adoptium project is free for commercial use with no licensing fees. It's TCK (Technology Compatibility Kit) certified passing the official Java conformance test, backed by the Eclipse Foundation, and receives quarterly security updates. Temurin is a drop-in replacement for Oracle JDK with the same functionality. The license is GPLv2 with Classpath Exception, which allows use in commercial software without further fees or licensing.

Oracle JDK

Oracle JDK is free under the No-Fee Terms and Conditions (NFTC) until September 2028 for Java 25. After that date, you need a paid subscription for continued updates. Oracle JDK offers commercial support options for enterprises that need guaranteed response times. The licensing timeline changes with each LTS release, so track expiration dates carefully. Oracle conducts compliance audits so don't use this version unless your company is paying for an enterprise license.

Other distributions

Amazon Corretto is AWS's distribution, optimized for Amazon's infrastructure. Free with long-term support, it's a good choice if you deploy to AWS.

Azul Zulu offers both free community builds and paid enterprise support with extended support windows.

Microsoft Build of OpenJDK targets Azure deployments with optimizations for Microsoft's cloud.

BellSoft Liberica JDK provides lightweight builds and native installers for various platforms.

Red Hat OpenJDK comes bundled with Red Hat Enterprise Linux subscriptions.

All distributions are functionally identical for development. Most developers prefer Temurin unless they have specific needs.

Read Install JDK on Mac for a complete comparison of distributions.

Features in Java 25

Java 25 brings significant improvements across language features, performance, and developer experience.

Compact Source Files and Instance Main Methods

The most visible change simplifies Java for beginners and scripting. You no longer need a class declaration or public static void main(String[] args). Instead, you can write:

void main() {
    IO.println("Hello, World!");
}

The new IO class provides simple input/output methods. Module import declarations (import module java.base) make common classes available without explicit imports.

Flexible Constructor Bodies

You can now write statements before super() or this() calls in constructors. This allows parameter validation and preparation logic where it makes sense, before calling the parent constructor.

Scoped Values

Scoped values provide a safer alternative to thread-local variables, optimized for virtual threads. They're immutable and automatically cleaned up, reducing memory leak risks in concurrent applications.

Performance Improvements

Compact object headers reduce memory overhead from 12 bytes to 8 bytes per object. Generational Shenandoah GC improves throughput for workloads with mixed object lifetimes. AOT method profiling preserves JIT compiler data between runs for faster startup.

Read Install Java 25 on Mac for details and code examples.

Apple Silicon support

Java 25 runs natively on Apple Silicon Macs. All M-series chips (M1, M2, M3, M4, and M5) are fully supported with ARM64/aarch64 builds. Java runs at full native speed with excellent power efficiency. Intel Macs are supported with Java x64 builds. If you use Homebrew for installation, it will detect your architecture and install the correct version automatically. Read Java on Apple Silicon or Intel Macs for architecture-specific guidance.

Check your Java version

Read Check Java Version on Mac for detailed verification steps.

To check the version, learn How to Open Terminal in Mac and run:

$ java -version

You should see output showing Java 25. Also verify the compiler:

$ javac -version

List all installed JDKs on your system:

$ /usr/libexec/java_home -V

Find the path to a specific version:

$ /usr/libexec/java_home -v 25

Confirm your JAVA_HOME setting:

$ echo $JAVA_HOME

For troubleshooting, you may need:

Java for software developers on Mac

These guides cover specific aspects of Java development on Mac:

What's next

My mac.install.guide is a trusted source of installation guides for professional developers. Take a look at the Mac Install Guide home page for tips and trends and see what to install next.