EMZETT.
Login

JDK

In short: Java Development Kit — the complete toolset for writing, compiling and running Java programs.

In more detail: Contains, among other things, the compiler (javac), the runtime environment (the JRE with the JVM), and debugging tools. Anyone who only wants to run finished Java programs only needs the JRE; developing requires the full JDK.

In Depth

The relationship between the three terms can be understood as a layered model: the JVM (Java Virtual Machine) executes bytecode, the JRE (Java Runtime Environment) bundles the JVM together with the standard libraries needed to run finished programs, and the JDK (Java Development Kit) additionally contains the development tools on top of the JRE — above all the compiler javac, which translates .java source files into .class bytecode.

javac Hello.java   # compiles to Hello.class (bytecode)
java Hello          # runs the bytecode via the JVM

Since Java 11, there’s no longer a standalone JRE download package from Oracle — anyone who just wants to run programs today usually also installs a (leaner) JDK, or uses tools like jlink to build a minimal runtime environment tailored to their own application. Various vendors (Oracle, Eclipse Adoptium/Temurin, Amazon Corretto) offer their own, usually compatible JDK distributions, often with different support periods and licensing terms.

LTS vs. feature versions

Since Java switched to a six-month release cadence in 2018, a distinction is made between regular feature releases (short support, usually only until the next version) and long-term support versions (LTS, e.g. Java 8, 11, 17, 21), which receive security updates for years. Production environments almost exclusively use an LTS version — constantly updating to every new feature version would be unnecessary effort for a company with stable requirements, while LTS versions offer predictable support for years.

Tools in the JDK beyond javac

A complete JDK also brings other command-line tools frequently needed in everyday use, besides the compiler: jar for bundling compiled classes into an executable JAR file, jshell as an interactive Java console for quickly trying out code snippets without a complete project setup, jdb as a command-line debugger, and javadoc for automatically generating HTML documentation from specially formatted comments in the source code.

Managing several JDKs in parallel

In practice, developers often work on several projects with different Java version requirements at the same time — a legacy system might still run on Java 8, while a new project uses Java 21. Tools like SDKMAN! (Linux/macOS) or jenv allow several JDK versions to be kept installed in parallel and switched between specifically per project directory or terminal session, without having to manually adjust system environment variables.

Module system since Java 9

Since Java 9, the JDK has supported a module system (Project Jigsaw), which allows the standard library and your own applications to be divided into clearly bounded modules with explicit dependencies, instead of a single monolithic classpath — this enables smaller, tailored runtime environments (via jlink) and makes internal implementation details of the standard library more strictly encapsulable, closing off internal APIs that were previously unintentionally accessible.

See also: Java, SDK