JDK Distributions

Naveen AnamaneniUpdated · 5 min read

When you go to download Java, you'll find several websites offering "the JDK". It's easy to get confused, or to install one that your company isn't allowed to use without paying. A few minutes understanding distributions saves you that trouble, and it's a common question in team discussions when a project is set up.

One Source, Many Builds

One source code, many builds

Think of OpenJDK as a recipe that everyone can read. Different companies cook from that same recipe, test the result and hand it out. The food tastes the same, but each company offers different service: how long they'll keep it fresh, whether they charge, and whether you can call them for help.

The official test that a JDK behaves like Java SE is called the TCK (Technology Compatibility Kit). The main distributions below are tested against it, so your code runs the same on all of them.

Common Distributions

DistributionFromGood to know
Oracle JDKOracleOracle's own build. Free under Oracle's terms for recent versions for a limited period; check the license before using it at work
Oracle OpenJDK buildsOracle (jdk.java.net)Free and open source, but updated only for six months per version
Eclipse TemurinEclipse AdoptiumFree, open source, very widely used; a good default
Amazon CorrettoAmazonFree, with long-term updates; common on AWS
Microsoft Build of OpenJDKMicrosoftFree; common on Azure
Azul ZuluAzulFree builds, with paid support available
Red Hat build of OpenJDKRed HatIncluded with Red Hat Enterprise Linux

GraalVM is related but different: it is a JDK with extra tools, including one that turns a Java program into a native executable file.

Which One Should You Install?

You areInstall
Learning Java (this course)Eclipse Temurin 25
Working on a company projectWhatever the project already uses; ask your team lead
Deploying to AWS or AzureOften Amazon Corretto or Microsoft Build of OpenJDK

The lesson "Installing the JDK" walks you through it step by step.

See Which JDK You Are Running

Java can tell you its version and who built it.

WhichJdk.java▶ Try it
public class WhichJdk {
    public static void main(String[] args) {
        String version = System.getProperty("java.version");
        String vendor = System.getProperty("java.vendor");
 
        System.out.println("Java version: " + version);
        System.out.println("Vendor: " + vendor);
    }
}
Output
Java version: 25.0.1
Vendor: Eclipse Adoptium

This output comes from Eclipse Temurin 25. Your output depends on the JDK you have installed.

How it works

  1. Line 3 reads the system property java.version, the full version of the running Java.
  2. Line 4 reads java.vendor, the company or project that built this JDK.
  3. Lines 6 and 7 print both values.

Try it yourself: run it on your computer after you install Java (see "Installing the JDK"). Which vendor and version do you see?

Common Mistakes

Thinking OpenJDK is a "cheaper" or weaker Java. Oracle JDK and the free distributions are built from the same OpenJDK code. For learning and for most production use, a free distribution works exactly the same.

Using Oracle JDK at work without checking the license. Oracle's terms have changed over the years, and some uses need a paid subscription. Companies often choose a free distribution to avoid this question.

Installing three JDKs and losing track. It's fine to have several, but know which one your terminal and your IDE use. The java -version command tells you.

Practice

  1. Easy: In one sentence, explain the difference between OpenJDK and Eclipse Temurin.
  2. Harder: Change WhichJdk to also print System.getProperty("os.name"). What does it print on your computer?

Quick check: JDK distributions

4 questions
1What is OpenJDK?
2Will a program behave differently on Eclipse Temurin and Amazon Corretto?
3Which distribution does this course recommend for learning?
4Which system property tells you who built the running JDK?

Key Takeaways

Was this tutorial helpful?

Lesson 6 of 482