JDK Versions & Distribution¶
Status: 🟢 Active | Owner: Java Guild
Current Standard¶
| Version | Status | Notes |
|---|---|---|
| Java 21 LTS | ✅ Required | All new services |
| Java 17 LTS | ⚠️ Supported | Existing services only — must plan upgrade |
| Java 11 LTS | ❌ Deprecated | End-of-life; migrate immediately |
| Java 8 | ❌ End-of-life | Not supported |
Approved Distribution¶
Eclipse Temurin (formerly AdoptOpenJDK) is the approved JDK distribution for all environments.
- Do not use Oracle JDK (licence restrictions).
- Do not use Amazon Corretto unless deployed exclusively on AWS Lambda (licence and support considerations).
- GraalVM Native Image is approved for specific use cases — requires Architecture Team sign-off.
Docker Base Images¶
Always use the Temurin slim variant:
# Runtime image
FROM eclipse-temurin:21-jre-alpine AS runtime
# Build image (multi-stage)
FROM eclipse-temurin:21-jdk-alpine AS builder
Never use the full JDK in the runtime stage of a Docker image.
Local Development¶
Use SDKMAN! to manage JDK versions locally:
Pin the project version in .sdkmanrc:
Commit .sdkmanrc to the repository. SDKMAN! will automatically switch to the correct version when entering the project directory.
CI Configuration¶
Upgrade Policy¶
- Patch releases (21.0.2 → 21.0.3): Apply within 30 days.
- LTS to LTS (17 → 21): Required within 3 quarters of the new LTS becoming the standard.
- Non-LTS releases are not approved for production use.
Java 21 Features in Active Use¶
The following Java 21 features are approved and encouraged:
- Records — immutable data carriers, replacing POJOs.
- Sealed classes — closed type hierarchies, enables exhaustive
switch. - Pattern matching for
instanceof— replaces verbose casting. - Virtual threads (Project Loom) — available via Spring Boot 3.2+ configuration.
- Text blocks — multi-line strings.
- Switch expressions — expression form of
switch.
References¶
Last reviewed: 2025-Q4 | Owner: Java Guild