Oracle Java

What's the Difference Between OpenJDK and Java?

by VanL

One common question we get at OSPOCO is about Java and the OpenJDK. Are they the same thing? What licenses apply? Understanding the difference can save you thousands of dollars if Oracle comes knocking. The takeaway: you need to not only understand that you are using Java, you need to understand where your developers are downloading Java.

What is Java?

A first source of confusion is the term "Java" itself. Java isn't just one thing, it is an entire programming and software system. To understand Java, you first have to take apart all of the acronyms that describe all the parts of the Java system. There are four important parts: Java the language, the JVM (Java Virtual Machine), the JRE (Java Runtime Environment), and the SDK (Software Development Kit). Looking at them each individually:

Java the language: Java is a high-level, object-oriented programming language. When someone is talking about developers "using Java" or something being "written in Java," they are referring to the language itself - a syntax and a set of standards that developers use to write code. Java the language is free for anyone to use - anyone can use the rules and syntax to write a program in the Java language.

The JVM (Java Virtual Machine): Java source code is compiled into bytecode, a binary format that is "run" by a specialized program called the Java Virtual Machine. When someone is saying that they are "running Java," or that it "runs on Java," they are referring to the JVM.

The JRE (Java Runtime Environment): Under most circumstances, just having a JVM is not enough - you also need the Java Runtime Environment. The JRE is a software package that includes libraries and other resources needed to run Java applications. The JRE does not include development tools - it is designed for end-users who want to run Java applications on their systems.

The JDK (Java Development Kit): The JDK is a comprehensive package that provides tools and resources for developing Java applications. It includes the JRE, the JVM, and additional development tools such as compilers, debuggers, and libraries. The JDK empowers developers to write, compile, debug, and run Java programs. It offers everything needed to create Java applications, from coding to testing and deployment.

Which Java are you talking about?

Different vendors, including Oracle, provide JDKs and JREs for people to use. Even though all of these Java environments are compatible, and frequently use the same source code, they can come with different licensing requirements.

The core "Java" is controlled by Oracle. Oracle provides and manages the source code for the "OpenJDK," a source-code-only open source project. Oracle also provides "Java"-branded JREs and JDKs through Oracle.com. Anyone downloading "Java" from Oracle (i.e. the JRE or JDK) is required to enter into a commercial license with Oracle, the terms of which usually require payment per-employee. We'll refer to this as "Oracle Java."

Because the Java source code is open source, many other vendors (like Amazon, Red Hat, and SAP) are motivated to create their own supported Java-compatible runtimes, rather than requiring customers to obtain commercial licenses from Oracle. These vendors usually sign an agreement to use Oracle's Technology Compatibility Kit, which ensures compatibility with Oracle's Java. However, these agreements typically do not allow them to use the term "Java" in their marketing except to describe how they are compatible with the standards that are part of Java-the-language.

There are a few companies (like Azul ) that have licensed the ability to use the name "Java" from Oracle. But most companies providing JREs and JDKs have branded distributions that do not use the term "Java" in their name (like " Amazon Corretto, " and " SAP Machine. "). Other companies (like Red Hat) say they provide the " Red Hat build of the OpenJDK. " These companies are allowed make truthful statements about their compatibility with Java SE specifications while avoiding any direct use of the term "Java." These Java distributions may come with commercial support and associated fees.

There are also fully community-supported builds of the OpenJDK, like " Adoptium " and " Eclipse Temurin. "

Open source and Java

The core Java distribution is available under the GPL version 2 plus the classpath exception. This license arrangement requires that the Java Virtual Machine and the other parts of the JRE and JDK stay open source - but your software can use a JRE (i.e., "run on Java") without it affecting the license of your application. If you distribute a JRE with your application you will need to provide a copy of the OpenJDK source code, but under most circumstances that should be all that is needed.

Other licensing requirements and Java

When using or deploying Java, however, your license to Java depends on where you download it from. If you download or use Oracle's Java, you will likely owe licensing fees to Oracle. If you use Azul's Java, you will need to pay Azul for a commercial license. If you use the Red Hat build of the OpenJDK that you get from the Red Hat Enterprise Linux distribution, you may need to pay support fees to Red Hat. On the other hand, if you get your Java from Amazon (Corretto) or from a community-supported distribution (Temurin or Adoptium), then you will not have any additional fees just as a result of downloading and using the JVM.