This post explains the most relevant concepts about the software needed to run and/or compile Java on a device.
It also clarifies the differences between concepts like JVM, JRE, JDK, OpenJDK or Java SE.
A Java platform is a software that can be installed on a device make it able to run Java code on it.
There are different Java platforms editions within the Java software-platform family:
- Java SE (Standard Edition): desktop and server
- Java ME (Micro): mobile
- Jakarta EE (Enterprise Edition): extension of Java SE with enterprise features like distributed computing and web services
- Java Card
The default edition is, as the name itself says, Java SE. Java ME would be a reduced edition of Java SE, thinking on smaller devices. Jakarta EE is the opposite: an extension of Java SE with enterprise features, aimed to business servers. JavaFX offers a more modern Graphical User Interface (GUI) than Java SE. Java Card is a software technology that allows Java-based applications (applets) to be run on smart cards.
Java platforms are defined as specifications and standards, so there could be different implementations of the same platform by different providers.
Java SE is a platform for development and deployment of Java portable code for desktop and server environments. It is the most popular of all Java platforms.
There are different implementations of this platforms of Java SE by different vendors. There reference one is OpenJDK, and all the others are based on this one.
JavaFX is a Java platform.
JavaFX was a GUI library that was originally included in the Java implementations by Oracle and was expected to replace Java Swing GUI. However, it was removed from the standard and moved to its own Java platform.
JavaFX was made open-source and included in OpenJDK 11 and later versions with the name of OpenJFX project.
Java Platform Components
Java Virtual Machine (JVM)
Java Virtual Machine (JVM) is the virtual machine that runs the Java bytecodes. The JVM does not understand the human-readable Java source code; because of this, you need compile your
*.java files to obtain
*.class files that contain the bytecodes understood by the JVM.
The JVM is also the entity that allows Java to be a “portable language” (write once, run anywhere). JVM has been coded independently for each operating systems (Windows, Linux, macOS, and many others), and it acts as a translator between the Java application and the machine. The idea is that the same bytecode run by the JVM on ANY operating system produces the same result, obtaining cross-platform applications.
JDK and JRE are the actual files downloaded and installed on a computer to run or develop Java program, respectively. One of the components installed by JRE and JDK is the JVM.
Take into account that having a JVM (or installing a JRE or JDK) in your computer is a prerequisite to be able to run Java bytecode on your computer.
Java Runtime Environment (JRE)
Java Runtime Environment (JRE) is a software that execute live Java programs.
JRE provides the libraries, the Java Virtual Machine (JVM), and other components to run applications written in the Java programming language. It is also the foundation for the technologies in the Java 2 Platform, Enterprise Edition (J2EE) for enterprise software development and deployment.
JRE does not contain tools and utilities such as compilers or debuggers for developing Java applications.
Java Development Kit (JDK)
Java Development Kit (JDK) is a superset of the JRE that contains everything that is in the JRE plus tools such as the compilers and debuggers necessary for developing Java SE applets and applications.
The official, open-source and reference implementation of the JDK is called OpenJDK. There are different implementations of OpenJDK, and some of them are listed in section “Java SE implementations” of this post.
Since Java 9 the JRE, JDK and some libraries/frameworks are restructured in modules. Modularity was introduced in JSR 376.
Custom JDK images can be created that only include specific modules, reducing the overall size of the image.
JLink would be a Java linker, it means, a tool that allows to create customized or reduced versions of JDK.
JLink is explained in Java Enhancement Proposal (JEP) 282.
JPackage is a tool to create self-contained Java packages that includes the runtime environment along with the application. It means that the user would be able to run the application without having installed JRE or JDK on their computer.
Take into account that, unlike traditional Java programs, applications deployed with JPackage are not cross-platform, and you need to create a different package for each OS.
JPackage is available since OpenJDK 16.
Java Platform Module System
Java Platform Module System (JPMS) adds modularity to Java, and was introduced in Java 9. JPMS specifies a distribution format for collections of Java code and associated resources.
You can find more information about JPMS on this external link.
Java SE Implementations
As the official reference implementation of Java SE, called OpenJDK, is open-source, there are different implementations by different vendors.
In fact, many big companies have created their own implementation of Java SE. You can find implementations from Oracle, IBM or Microsoft.
You can find a list of all OpenJDK builds on this external link.
Open Java Development Kit (OpenJDK) is a free and open-source implementation of Java SE.
OpenJDK is the official reference implementation of Java SE. The alternative Java SE implementations (including Oracle Java SE) are based on OpenJDK.
Official instructions about how to install OpenJDK can be found on this external link.
OpenJDK has not the friendlier installation procedure of Java on OS different to Linux. Installing OpenJDK in Windows requires applying many manual steps. On the contrary, installing it in Linux through package managers (e.g., apt, yum) is very automatic.
Duke is the mascot of Java. Because it has the open-source license BSD, it is used by the open-source implementations of Java. If you find Duke’s logo when running a program, it is probably running an OpenJDK implementation and not Oracle Java implementation (that uses the cup of coffee instead).
Temurin is a OpenJDK build by Eclipse Foundation. It is developed by the Eclipse Adoptium workgroup. Before this workgroup joined the Eclipse Foundation project, they worked as AdoptOpenJDK.
It uses a permissive license.
Its initial release was October 2021. You can check the lifecycle support dates on this external link.
There is a clarifying migration guide explaining how to migrate from Oracle JDK to Eclipse Temurim and suggesting open source alternatives to Oracle proprietary components.
Oracle Java SE
Oracle Java SE is the OpenJDK built by American company Oracle. Its logo is a cup of coffee, so when you find this logo, you can be sure that it is using Oracle’s implementation of Java.
Oracle is the owner of Java since it acquired Sun Microsystems in 2010.
There are two downloadable software for Oracle Java SE: Oracle JRE and Oracle JDK.
The main difference between OpenJDK and Oracle JDK is that the first one is free of use (GPL license), and the second one has a commercial license since Oracle JRE/JDK 8.0.221 (2019-01-16). You need to pay for Oracle JDK in certain situations. Last Oracle Java freeware release was 8.0.202 (2019-01-15) or 8.0.211 (2019-04-16). The release dates have been obtained from the release date history.
Other differences is that Oracle JDK adds extra components like Java Plugin and Java Web Start (JWS) (but only until Java 8), some closed source third party components (like a graphics rasterizer), some open source third party components (like Rhino), additional documentation or third-party fonts that are not included OpenJDK.
According to Oracle, its intent is to open source all pieces of the Oracle JDK except those that they consider commercial features such as JRockit Mission Control (not yet available in Oracle JDK), and replace encumbered third party components with open source alternatives to achieve closer parity between the code bases.
With all due cation, we can say that OpenJDK is to Oracle Java what Chromium is to Chrome, though Chrome is (still) completely free.
You might also be interested in…
- Introduction to Java
- Java Programming Language
- Oracle; “Java SE Technologies“; Oracle.
- Donald Smith; “Oracle JDK Releases for Java 11 and Later“; Oracle, 2018-09-11.
- Alain Janin-Manificat; “What is the difference between JVM, JDK, JRE, OpenJDK?“; stackoverflow.
- Nick Heath; “Can you still use the Java programming language for free?“; TechRepublic
- Luca Guadagnini; “JavaFX, JLink and JPackage“; CherryChain at Dev.to
- Stewart X Addison; “JLink to produce your own runtime“; Adoptium
[…] To read about Java platform and its components, please check this post. […]
Thanks for the article!
And thanks for your comment 🙂