| Feature | OpenJDK (Oracle) | GraalVM CE | GraalVM EE | Amazon Corretto |
|---|---|---|---|---|
| Vendor | Oracle | Oracle (open-source) | Oracle (commercial) | Amazon Web Services |
| License | GPLv2 + CE | GPLv2 + CE | Oracle NFTC / Commercial | GPLv2 + CE |
| Native Image | No | Yes (free) | Yes (optimized) | No |
| Startup Time (JVM) | ~300–600ms | ~300–600ms | ~300–600ms | ~280–550ms |
| Startup Time (Native) | N/A | 5–80ms | 5–50ms | N/A |
| Memory Footprint | High (JVM heap) | Medium (JVM) / Low (Native) | Low (Native optimized) | Medium-High |
| LTS Support | 6 months per release | Follows OpenJDK LTS | Extended commercial | Free, multi-year LTS |
| Polyglot (JS, Python, Ruby) | No | Yes (Truffle) | Yes (Truffle, optimized) | No |
| Best For | Reference builds, dev | Serverless, microservices | Enterprise native apps | AWS workloads, enterprises |
| Cost | Free | Free | Commercial license | Free |
In 2026, "install Java" is no longer a simple answer. The Java ecosystem has fragmented into over a dozen distributions, each making different trade-offs between performance, licensing, cloud-native capabilities, and long-term support. For most of the 2000s and early 2010s, developers defaulted to Oracle JDK without much thought. Then came Oracle's 2019 licensing change — requiring a commercial license for Oracle JDK in production — and the landscape shattered into competing distributions almost overnight.
Today, three names dominate the conversation: OpenJDK (the canonical open-source reference implementation), GraalVM (Oracle's polyglot, native-compilation powerhouse), and Amazon Corretto (AWS's enterprise-hardened, freely-supported distribution). Each solves a different problem, and picking the wrong one can mean either unnecessary complexity or leaving significant performance gains on the table.
The stakes are real. If you are running a Spring Boot microservice on AWS Lambda, the difference between a Corretto JVM cold start (~1,500ms) and a GraalVM Native Image cold start (~60ms) can be the difference between your application feeling snappy or visibly laggy for end users — and a measurable difference in AWS bill. Conversely, if you are running a Kafka consumer processing millions of records per day, GraalVM Native Image's limited JIT capabilities can actually hurt throughput compared to a well-tuned Corretto JVM.
This guide gives you the complete picture: architecture, benchmarks, Spring Boot compatibility, cloud behavior, and clear "when to choose" guidance for each distribution. We also cover the second-tier players — Eclipse Temurin, Azul Zulu, and Microsoft Build of OpenJDK — so you have the full map.
OpenJDK is the official open-source reference implementation of the Java SE Platform. When the community or the JCP (Java Community Process) ratifies a new Java version, OpenJDK is the codebase that embodies that specification. Oracle leads the OpenJDK project and employs many of its core engineers, but contributions come from Red Hat, Google, Microsoft, Amazon, SAP, and dozens of independent contributors.
An important distinction: Oracle produces builds of OpenJDK — the binaries you download from jdk.java.net — but these are not the same as "Oracle JDK" (the commercial distribution). Oracle's OpenJDK builds are free under GPLv2 + Classpath Exception. However, they only receive updates for 6 months — the duration of one Java release cycle. Once Java 25 ships, Java 24 Oracle OpenJDK builds go dark.
Since Java 9, Oracle has shipped a new Java version every 6 months (March and September). Every ~two years, one release is designated LTS (Long-Term Support). The current LTS versions are:
Non-LTS releases (22, 23, 24) are stepping stones. Most enterprises skip them entirely and stay on LTS versions where vendor distributions provide long-term patches.
OpenJDK is the source — every major JDK distribution is essentially a build of OpenJDK with its own patches, tooling, and support model. This means switching between Corretto, Temurin, Zulu, or Microsoft Build typically requires no code changes. GraalVM is the notable exception: it extends OpenJDK's compiler infrastructure with its own optimizing JIT (Graal compiler) and AOT pipeline.
GraalVM is not just another OpenJDK build — it is a fundamentally different runtime that replaces the standard HotSpot C2 JIT compiler with the Graal compiler (written in Java itself), and adds an entirely new compilation mode: Ahead-of-Time (AOT) native image compilation.
At its core, GraalVM ships in two modes:
The native-image tool performs a closed-world analysis — it traces all reachable classes, methods, and fields from your application entry points and includes only what is provably needed. The result is a self-contained ELF/Mach-O binary that:
| Dimension | JIT (HotSpot / GraalVM JVM mode) | AOT (GraalVM Native Image) |
|---|---|---|
| Startup Time | 300ms – 3,000ms | 5ms – 80ms |
| Peak Throughput | Very high (profile-guided optimization) | Lower (no runtime profiling) |
| Memory at Startup | 150MB – 500MB RSS | 30MB – 120MB RSS |
| Build Time | Seconds (javac) | 1–10 minutes (native-image) |
| Reflection / Dynamic Class Loading | Full support | Requires configuration (reflect-config.json) |
| Best Workload Type | Long-running, high-throughput services | Serverless, CLI, short-lived containers |
GraalVM's second superpower is its Truffle language implementation framework. Truffle lets language implementors write an AST interpreter for any language, and GraalVM's partial evaluation will JIT-compile it to near-native performance automatically. This enables:
Polyglot is mostly relevant to platform teams and language implementors. Most application developers use GraalVM purely for its native image capabilities.
# Build Spring Boot 3.4 native image with GraalVM 21
# Prerequisites: GraalVM 21+, native-image tool installed
# Using Maven
./mvnw -Pnative native:compile
# Using Gradle
./gradlew nativeCompile
# The resulting binary (no JVM required at runtime)
./target/my-service
# Typical output:
# Started MyServiceApplication in 0.072 seconds (process running for 0.092)
# (vs. ~2.4 seconds on JVM)
Spring Boot 3.x includes the Spring AOT engine that generates proxy-free, reflection-minimized versions of your application context specifically for GraalVM native compilation. Most common Spring features (JPA, Security, Web MVC, WebFlux) are fully supported. Libraries with heavy reflection (some older third-party libraries) may require additional reflect-config.json hints.
Amazon Corretto is AWS's no-cost, production-ready distribution of OpenJDK. Amazon introduced it in 2019 after Oracle's licensing changes created uncertainty in the enterprise Java ecosystem. Corretto is what AWS uses internally to run its own services — from S3 to DynamoDB control planes — which means it is battle-tested at extraordinary scale.
Corretto is 100% TCK-compliant (passes the Java SE Technology Compatibility Kit), meaning it is a certified Java SE implementation. You can drop it in anywhere you were using Oracle JDK or any other OpenJDK distribution without changing a single line of code.
Corretto is not a plain OpenJDK repackage. Amazon's JVM team backports critical patches and applies performance improvements specifically tuned for AWS infrastructure:
amazon-linux-extras install java-openjdk21)| Java Version | Corretto Support Until | Status |
|---|---|---|
| Java 8 | May 2026 | End of Life |
| Java 11 | September 2027 | Active LTS |
| Java 17 | October 2029 | Active LTS (recommended) |
| Java 21 | September 2031 | Active LTS (recommended) |
| Java 25 | ~2033 | Upcoming LTS |
Beyond the big three, several other distributions are worth knowing:
| Distribution | Vendor | License | LTS | Best For |
|---|---|---|---|---|
| Eclipse Temurin | Eclipse Adoptium | GPLv2 + CE | Free, multi-year | Vendor-neutral, community-preferred production JDK |
| Azul Zulu | Azul Systems | Free (CE) / Commercial | Free LTS + paid extended | Teams wanting optional commercial support SLAs |
| Microsoft Build of OpenJDK | Microsoft | GPLv2 + CE | Free LTS | Azure workloads, Windows-heavy shops |
| Azul Zing / Platform Prime | Azul Systems | Commercial | Yes (paid) | Ultra-low latency (C4 GC — pause-free), trading systems |
| Oracle JDK | Oracle | NFTC (free for production in 2023+) | Yes (Oracle support) | Teams already in Oracle ecosystem with OCI/Java SE subscriptions |
The following benchmarks represent representative results from Spring Boot 3.4 microservice workloads, serverless cold-start tests, and throughput benchmarks. Hardware: AWS Graviton3 c7g.large (2 vCPU, 4 GB RAM) and AWS Lambda with 512 MB memory.
| Metric | OpenJDK 21 (JVM) | Corretto 21 (JVM) | GraalVM 21 (JVM mode) | GraalVM 21 (Native) |
|---|---|---|---|---|
| Startup Time (Spring Boot 3.4) | ~2,450ms | ~2,280ms | ~2,100ms | 68ms |
| RSS Memory at Start (MB) | ~320 MB | ~295 MB | ~310 MB | ~72 MB |
| Peak Throughput (req/s, Wrk benchmark) | ~18,400 | ~19,200 | ~19,800 | ~15,600 |
| Lambda Cold Start (512MB) | ~1,600ms | ~1,480ms | ~1,450ms | ~62ms |
| Lambda Warm Invocation (p99 latency) | ~12ms | ~11ms | ~11ms | ~14ms |
| Docker Image Size (distroless) | ~210 MB | ~210 MB | ~215 MB | ~38 MB |
| Native Image Build Time | N/A | N/A | N/A | ~4–7 minutes |
| P99 Latency (JVM warm) | ~18ms | ~16ms | ~15ms | ~13ms |
Spring Boot 3.x introduced first-class support for GraalVM Native Image via the Spring AOT (Ahead-of-Time) processing engine. Understanding how each JDK behaves with Spring Boot is essential for modern Java development.
For traditional JVM deployments, all three behave nearly identically. Spring Boot's auto-configuration, dependency injection, and component scanning work exactly as expected. You get the full flexibility of reflection, dynamic proxies, and runtime classpath scanning.
# Standard Spring Boot application.properties for JVM mode
# No special configuration needed for Corretto or OpenJDK
spring.application.name=my-service
spring.datasource.url=jdbc:postgresql://localhost:5432/mydb
server.port=8080
# Typical JVM flags for Corretto on containers
# -XX:+UseG1GC -XX:MaxRAMPercentage=75.0 -XX:+ExitOnOutOfMemoryError
Spring Boot 3.x ships with the spring-boot-starter-parent (3.x) which includes the Spring AOT Maven/Gradle plugin. When you run a native build, Spring AOT pre-processes your application context at build time, generates proxy-free bean definitions, and produces GraalVM reachability metadata automatically for all Spring-managed components.
<!-- pom.xml: Enable native image compilation -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.1</version>
</parent>
<profiles>
<profile>
<id>native</id>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
# Build the native executable
./mvnw -Pnative native:compile -DskipTests
# Result: ./target/my-service (self-contained binary, no JVM needed)
# Run it:
./target/my-service --spring.datasource.url=jdbc:postgresql://db:5432/mydb
reflect-config.json)@RegisterReflectionForBinding and @ImportRuntimeHints annotations (Spring 6+) to register reflection metadata without hand-editing JSON config files. Most Spring Boot starter libraries ship their own GraalVM hints — check the GraalVM Reachability Metadata repository for community-contributed hints.
AWS Lambda's billing model charges for duration from invocation start to completion, and cold starts (where a new Lambda container is initialized) include full JVM startup time. For a typical Spring Boot + Corretto Lambda:
This means the first user request after a cold start can be visibly slow — a real UX problem for user-facing APIs. With GraalVM Native Image:
AWS officially supports GraalVM native binaries on Lambda through the Custom Runtime (provided.al2023) runtime. You package your native binary as a bootstrap executable in your deployment ZIP or container image.
# Lambda custom runtime — Dockerfile for GraalVM native image
FROM ghcr.io/graalvm/native-image:ol9-java21-22.3 AS build
WORKDIR /app
COPY . .
RUN ./mvnw -Pnative native:compile -DskipTests
FROM public.ecr.aws/amazonlinux/amazonlinux:2023
COPY --from=build /app/target/my-service /var/runtime/bootstrap
RUN chmod +x /var/runtime/bootstrap
CMD ["/var/runtime/bootstrap"]
| Scenario | Corretto 21 (JVM) | GraalVM Native Image |
|---|---|---|
| Cold Start (512MB Lambda) | ~1,480ms | ~62ms |
| Warm Invocation (p50) | ~8ms | ~9ms |
| Memory for 1K req/s | 512MB minimum | 128–256MB sufficient |
| Monthly cost (1M invocations, 300ms avg) | ~$2.80 (512MB) | ~$0.98 (128MB) |
| SnapStart compatible | Yes (with Corretto 21 runtime) | N/A (native starts fast already) |
GraalVM is not universally better — it depends on the workload. GraalVM Native Image gives dramatically faster startup and lower memory usage, making it ideal for serverless and microservices. However, for long-running, throughput-intensive services, standard OpenJDK with JIT compilation often achieves higher peak throughput after warm-up. GraalVM's JIT (Graal compiler) is comparable or slightly faster than HotSpot C2 for some workloads, but the real differentiation is native image — not JIT.
Yes, absolutely. Amazon Corretto is 100% free for production use, including commercial applications. There are no per-CPU fees, subscription requirements, or usage restrictions. Amazon provides no-cost long-term support for Java 11, 17, 21, and upcoming LTS versions, making Corretto one of the most cost-effective OpenJDK distributions available in 2026.
GraalVM Native Image is an ahead-of-time (AOT) compiler that compiles Java bytecode into a standalone native binary at build time. It eliminates JVM startup overhead, shrinks memory footprint significantly, and eliminates cold-start latency. Use it for AWS Lambda functions, container microservices that scale to zero, CLI tools, and any workload where sub-100ms startup time is a hard requirement. Avoid it for workloads that rely on dynamic class loading or require peak JIT-optimized throughput.
For traditional Spring Boot deployments (JVM mode), Amazon Corretto 21 or Eclipse Temurin 21 are the top recommendations — both are free, LTS, and stable. For Spring Boot 3.x Native (Spring AOT + GraalVM native compilation), you need GraalVM 21 or GraalVM 23+. Native compilation reduces Spring Boot startup from 2–4 seconds to under 100ms, which is a transformative improvement for serverless and container environments.
Oracle's OpenJDK builds only provide 6 months of support per release. For long-term support (LTS), you need a vendor distribution: Amazon Corretto (free), Eclipse Temurin (free), Azul Zulu (free CE / paid EE), Microsoft Build of OpenJDK (free), or Oracle JDK (now free under NFTC for production). These vendors backport security patches and maintain LTS versions (17, 21, 25) for 5–8 years. Never run Oracle's raw OpenJDK builds in production without a plan for quarterly patching.
The JDK choice in 2026 is not a single right answer — it is a spectrum of trade-offs matched to your workload profile.
Amazon Corretto (or its community equivalent Eclipse Temurin) is the safe, proven, zero-cost choice for the vast majority of production Java workloads. It is what you should use by default for services that run continuously, need long-term patching, and operate on standard JVM assumptions. On AWS, Corretto's Graviton optimization and Lambda SnapStart support make it even more compelling.
GraalVM Native Image is the future for cloud-native, event-driven, and startup-latency-sensitive Java. The complexity cost — AOT build pipelines, reflection hints, incompatible libraries — is real, but the ecosystem has matured dramatically. Spring Boot 3.x, Quarkus, and Micronaut all provide first-class native image support. For serverless functions and microservices that scale to zero, native image is no longer experimental — it is production-ready.
Vanilla OpenJDK belongs in development environments and CI pipelines, not production. Use vendor distributions that commit to multi-year patching.
The winning strategy for most teams in 2026: use Corretto 21 on JVM for your core services, and progressively migrate your Lambda functions and lightweight microservices to GraalVM Native Image as your build pipeline matures. The performance gains are worth the investment.