Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsMay 9, 2026·3 min de lectura

OpenJDK — The Open-Source Java Development Kit

OpenJDK is the official open-source reference implementation of the Java Platform, Standard Edition. It provides the JVM, compiler, and standard libraries that power modern Java applications.

Introduction

OpenJDK is the free, open-source implementation of the Java SE Platform maintained by Oracle and a global community of contributors. It serves as the upstream source for virtually all production Java distributions including Eclipse Temurin, Amazon Corretto, and Azul Zulu.

What OpenJDK Does

  • Provides the HotSpot JVM with JIT compilation for high-performance bytecode execution
  • Includes javac, the standard Java compiler, and core class libraries
  • Ships tools like jshell (REPL), jlink (custom runtime images), and jfr (flight recorder)
  • Supports multi-platform targets: Linux, macOS, Windows, and various CPU architectures
  • Delivers new features on a six-month release cadence with LTS versions every two years

Architecture Overview

OpenJDK is organized into modules following the Java Platform Module System (JPMS). The HotSpot VM handles class loading, garbage collection (G1, ZGC, Shenandoah), JIT compilation (C1/C2 tiered), and runtime services. The javac compiler translates Java source to bytecode, which the VM interprets and optimizes at runtime. Platform libraries (java.base, java.net.http, java.sql) are modularized to allow minimal custom runtimes via jlink.

Self-Hosting & Configuration

  • Install from distribution packages, SDKMAN (sdk install java), or download from jdk.java.net
  • Set JAVA_HOME and PATH environment variables for build tools
  • Use jlink to create stripped-down runtime images containing only required modules
  • Tune GC with flags like -XX:+UseZGC or -XX:+UseShenandoahGC per workload
  • Enable preview features with --enable-preview for early access to upcoming language changes

Key Features

  • ZGC and Shenandoah provide sub-millisecond GC pauses for latency-sensitive apps
  • Virtual threads (Project Loom) enable millions of lightweight concurrent tasks
  • Pattern matching and sealed classes modernize Java's type system
  • Flight Recorder offers always-on production profiling with minimal overhead
  • GraalVM native-image support for ahead-of-time compiled binaries

Comparison with Similar Tools

  • GraalVM — Extends OpenJDK with polyglot support and native image; OpenJDK is the upstream standard
  • Kotlin — JVM language with more concise syntax; still runs on OpenJDK
  • Go — Compiles to native binaries with simpler concurrency; Java has a richer ecosystem and virtual threads
  • C#/.NET — Similar managed runtime model; OpenJDK leads in cross-platform server adoption
  • Eclipse Temurin — A downstream OpenJDK distribution with TCK certification and commercial support

FAQ

Q: What is the difference between OpenJDK and Oracle JDK? A: Since JDK 17, Oracle JDK and OpenJDK are functionally identical. Oracle JDK adds commercial licensing terms; OpenJDK is GPLv2+CE.

Q: Which version should I use? A: Use the latest LTS release (JDK 21) for production stability, or the latest feature release to access new APIs.

Q: How do virtual threads differ from platform threads? A: Virtual threads are lightweight, managed by the JVM, and can scale to millions without OS thread limits.

Q: Can I build OpenJDK from source? A: Yes. Clone the repo, run bash configure, then make images. Build instructions are in the doc/building.md file.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados