Java version confusions

Anyone working with deploying Java applications inevitably came across one of these confusions with the terms. Let’s clarify them. This clarification is not for Java developer and does not go deep with underlying technologies. This is for installation/DevOps engineers to understand Java environment.

Java SE, EE and ME

Java Platform, Standard Edition (Java SE) is a computing platform for development and deployment of portable code for desktop and server environments. Java SE was formerly known as Java 2 Platform, Standard Edition (J2SE). Java SE defines a range of general-purpose APIs, and also includes the Java Language Specification and the Java Virtual Machine Specification.

Java Enterprise Edition (Java EE), formerly Java 2 Platform, Enterprise Edition, currently rebranded as Jakarta EE but the new brand is still being adopted. It is an extension to Java SE with specifications for enterprise features such as distributed computing, web services, XML processing, JMS (messaging). It is more widespread in enterprise contexts such as e-commerce, accounting, banking information systems. The specification defines APIs and their interactions for providers to meet in order to declare compliance with Java EE. For example Apache Tomcat is an implementation of a subset of Java EE.

Java Platform, Micro Edition (Java ME, formerly knowned as Java 2 Platform, Micro Edition or J2ME) is a subset of Java SE for embedded and mobile devices. The advent of Android significantly de-popularized Java ME.

JRE and JDK

Java SE is the foundation for developing in Java language. The aforementioned platforms (Java SE, EE and ME) are just specifications, not implementations. Java Software Development Toolkit (SDK) is called JDK (Java Development Kit) for short. Strictly speaking, the JDK can be an implementation of any one of the platforms above. In every day language, people loosely refers to the implementation of Java SE as JDK, whereas Oracle’s implementation of Java EE is referred to as Java EE SDK.

JDK vs JRE

JDK consists of Java Runtime Environment (JRE) along with tools to compile and debug Java code for developing Java applications. JRE consists of libraries, Java Virtual Machine (JVM), Java Pluging and Java Web Start to run Java applications. JRE alone does not contain compilers and debugging tools. The two most widespread JDKs are:

  • Oracle JDK: Oracle’s official implementation of Java SE.
  • OpenJDK: a free and open-source implementation of Java SE.

They are both created and maintained by Oracle. Almost everything in Oracle JDK is from OpenJDK. The slight difference between them is an entirely separate topic itself but the idea is their binaries will be converged:

Oracle JDK was licensed under Oracle Binary Code License Agreement, whereas OpenJDK has the GNU General Public License (GNU GPL) version 2 with a linking exception. It is worth-noting that Oracle has announced that the Oracle JDK 8 builds released after Jan 2019 cease to be free for commercial use. This drives may application vendor to migrate from Oracle JDK to OpenJDK in their platforms.

Version History

If what you have read so far is not confusing enough, here’s some more muds. The version scheme for Java has changed in it’s 20 years history. Here is a list of main versions.

Platform VersionInternal VersionRelease DateNotes
JDK 1.01.0Jan 1996
JDK 1.11.1Feb 1997
J2SE 1.21.2Dec 1998In 1998 JDK splits into J2SE and J2EE. Code name for J2SE 1.2 is Playground
J2SE 1.31.3May 2000Code name is Kestrel
J2SE 1.41.4Feb 2002Code name is Merlin
J2SE 5.01.5Sep 2004In 2004, Sun introduced internal version and external version. Code name for this version is Tiger.
Java SE 61.6Dec 2006Code name Mustang
Java SE 71.7Jul 2011Code name Dolphin
Java SE 81.8Mar 20145 year from previous version, LTS
Java SE 91.9Sep 20173.5 year from previous version. Going forward new version will be released every six month
Java SE 1010Mar 2018It was proposed that versions should simply increase incrementally
Java SE 1111Sep 2018LTS
Java SE 1212Mar 2019
Java SE 1717Sep 2021LTS

Since 2018, new version will be release every six month and the there is no longer a distinction between internal and external versions.

Multi-version management

We only cover Linux here to manage multiple versions of JDK. We use a tool named alternatives to maintain symbolic links determining default commands. How this works with Java is:

  1. Make /usr/bin/java a symbolic link pointing to /etc/alternatives/java
  2. Make /etc/alternatives/java also a symbolic link pointing to the desired version of java

To start configuration, run:

alternatives --config java

Then you will be given a list of Java versions to choose from. If the list does not have your desired version, and you confirm that the version has been installed. You will need to add this version by doing something like:

alternatives --install /usr/bin/java java  /usr/java/jdk1.6.0_25/bin/java 1000

The command executes and takes effect by modifying files under /var/lib/alternatives directory.

Also, one can overwrite environment variable $JAVA_HOME to force an application to use a different version of Java. This is because many application picks up JDK location from that variable.