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.
Java Platforms
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
- JavaFX
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. It contains a subset of Java SE but also its own content. 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
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.
You can read this post about Java SE.
Jakarta EE
A web server contains the presentation handling, while an application server contains the business processes. An application server usually sits behind the web server.
A Java aplication server is an application server based on Java.
Apache JServ Protocol (AJP) is a binary protocol that can proxy requests from an Apache web server through a Java application server that sits behind the web server. It is packet-oriented.
Jakarta EE (formerly known as Java EE) is a specification of a Java application server.
You can read this post about Jakarta EE.
JavaFX
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.
JDK’s generally don’t offer auto update as they are released as major versions, you’ll only really need to worry about minor updates if some security updates come along.
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.
JLink
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
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.
You might also be interested in…
External References
- 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 🙂