Java Reference ยท Language Features by Version
Java versions overview
Overview of Java versions: the six-month release train, which releases are LTS (8, 11, 17, 21, 25), version numbers, preview features and how to check your runtime.
Java is released on a fixed schedule: a new feature release every six months, in March and September, since Java 10 (2018). Before that, releases were irregular (Java 8 in 2014, Java 9 in 2017). Each feature release is simply called by its number: Java 21, Java 22, Java 25.
Some releases are marked LTS (long-term support). Vendors such as Oracle, Eclipse Temurin (Adoptium), Amazon Corretto, Azul and Red Hat promise to ship security fixes for LTS versions for years, while the other releases are supported only until the next one arrives. The LTS releases are 8, 11, 17, 21 and 25. Up to Java 17 the gap between LTS releases was three to four years; from Java 17 on it is two years (17, 21, 25).
This site's examples run on Java 25, the current LTS in this reference.
Runtime.Version v = Runtime.version(); System.out.println(v.feature()); // 25
Try it
Press Run (or Ctrl + Enter) to see the result here.
Program input ยท what you'd type while the program runs
Type the answers before you press Run, one per line. Each time the program reads a line (with IO.readln() or a Scanner), it gets the next line from this box.
Press Run (or Ctrl + Enter) to see the result here.
Program input ยท what you'd type while the program runs
Type the answers before you press Run, one per line. Each time the program reads a line (with IO.readln() or a Scanner), it gets the next line from this box.
Reading version numbers
| Form | Meaning |
|---|---|
25, 25.0.1 |
Feature release 25; update 25.0.1 (a security or bug-fix update). |
1.8.0_402 |
The old scheme used up to Java 8. "Java 8" and "1.8" are the same thing. |
-ea, +36 |
Early-access build; +36 is the build number. |
| class file major version | 52 for Java 8, 55 for 11, 61 for 17, 65 for 21, 69 for 25 (feature version plus 44). |
Java 9 changed the scheme to $FEATURE.$INTERIM.$UPDATE.$PATCH, read with Runtime.version(). $INTERIM is always 0 in the six-month model, and $UPDATE counts quarterly update releases.
Usage notes
- Which one to use. For new projects choose the newest LTS that your frameworks support, or the newest release if you can upgrade every six months. Libraries should test against all LTS versions they claim to support.
- Compatibility is strong. Old class files run on newer JVMs. The reverse is not true: code compiled for Java 21 does not load on Java 17, unless you compile with
--release 17, which also restricts the APIs to Java 17's. --release Nis better than-source/-target, because it checks against the real API of version N.- Preview and incubator features ship in a normal release but are off by default and may change. Read preview features.
- Removed APIs. Things get deprecated first and removed later (for example
Thread.stop(), the Security Manager, Applets and Nashorn); see deprecated and removed APIs. - Free builds. Several vendors publish free OpenJDK builds for every release. Licenses and support terms differ; check the vendor's page before using a build commercially.
- Release dates are fixed, but the exact content of a release is decided late. JEP numbers (JDK Enhancement Proposals) identify each feature.
- Newer than 25. Features of releases after Java 25 are not covered by this reference; check the release notes for your JDK.