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 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.
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 Version||Internal Version||Release Date||Notes|
|JDK 1.0||1.0||Jan 1996|
|JDK 1.1||1.1||Feb 1997|
|J2SE 1.2||1.2||Dec 1998||In 1998 JDK splits into J2SE and J2EE. Code name for J2SE 1.2 is Playground|
|J2SE 1.3||1.3||May 2000||Code name is Kestrel|
|J2SE 1.4||1.4||Feb 2002||Code name is Merlin|
|J2SE 5.0||1.5||Sep 2004||In 2004, Sun introduced internal version and external version. Code name for this version is Tiger.|
|Java SE 6||1.6||Dec 2006||Code name Mustang|
|Java SE 7||1.7||Jul 2011||Code name Dolphin|
|Java SE 8||1.8||Mar 2014||5 year from previous version, LTS|
|Java SE 9||1.9||Sep 2017||3.5 year from previous version. Going forward new version will be released every six month|
|Java SE 10||10||Mar 2018||It was proposed that versions should simply increase incrementally|
|Java SE 11||11||Sep 2018||LTS|
|Java SE 12||12||Mar 2019|
|Java SE 17||17||Sep 2021||LTS|
Since 2018, new version will be release every six month and the there is no longer a distinction between internal and external versions.
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:
- Make /usr/bin/java a symbolic link pointing to /etc/alternatives/java
- 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.