Video in progress
A new JDK comes out every 6 months, and an LTS every 2 years. How do you set the policy for choosing and updating the JDK version and distribution in an organization?
Production runs only LTS (17, 21, 25) and one or two agreed distributions (Temurin, Corretto, Zulu or Oracle, depending on license and support period). Quarterly security updates roll out automatically, and the move to the next LTS is planned within 6-12 months of its release.
📖 Answer
Since Java 10, a feature release comes every 6 months (March and September), and since Java 17 an LTS comes every 2 years: 17, 21, 25. Interim releases go out of support as soon as the next one ships, so for production they're a "moving target".
I split the policy into three parts.
- Version.
- Production is LTS only. At most two LTS at a time (for example, 21 as the main one and 17 for older services, with an end date).
- An extra job in CI with the latest non-LTS: you see breakages for the next LTS two years ahead (
jdeprscan, warnings, removed flags). - Waiting 3-6 months after a new LTS comes out is normal: Spring, Hibernate, Lombok and APM agents release compatible versions.
- Distribution. They're all built from OpenJDK; the difference is who provides patches, for how long and under what terms:
| Option | When |
|---|---|
| Eclipse Temurin | a free, neutral default |
| Amazon Corretto | on AWS, free long support |
| Azul Zulu, Red Hat | if you need a paid SLA |
| Oracle JDK | the license terms have changed several times: check with the legal department |
The main thing is one or two options, the same for every team. If 40 services have 5 different vendors, you can't keep track of security patches.
- Update process.
- The quarterly CPU (January, April, July, October): the platform team updates the base Docker image, and services pick it up automatically on their next deploy. Renovate/Dependabot watches the image tag.
- Inventory: which service runs on which JDK build is in metrics (
java.version,java.vendorthrough JMX/Actuator). "We don't know" is the worst answer. - An LTS migration is run as a project: an owner, a deadline, a pilot service, and raising
--releasethrough the shared parent POM.
The measures: the share of production traffic still on the old LTS, and the number of services that are behind the latest CPU. Both numbers are clear to management and show the risk directly.
Sign up to mark studied questions and save your progress.