Understanding the Java versions and platforms

Understanding the Java versions and platforms

For those that might be confused, this post points out the different Java platforms in the form of versions, architectural variations, patch updates and editions.

Introduction to Java

For some new software developers, Java is not just overwhelming, but its platforms can also be confusing. This post points out the different Java platforms in the form of versions, architectural variations, patch updates and editions. Some references will be made using Windows 10 and The Raspberry Pi OS.

'Java' != 'JavaScript'

Before starting, it is important to know that Java and JavaScrip are not the same things. Apart from the fact that they are both computer programming languages and that they are equally very popular, their only commonality is the word “Java”.

Java

Java is a programming language and computing platform (an environment in which its code is executed) first released in 1995. Unlike JavaScript, which is mainly a client-side scripting language, Java is used to write fast, but robust and secure server-side applications and websites.

You might have heard, or seen, that Java is everywhere! Today, it is still used on billions of devices ranging from laptops, game consoles, cell phones, and data centres to scientific supercomputers.

Java took roughly four years to develop and is still in active development. Several new versions have been launched since its release. It is considered to be fast and secure, but it is not an easy-to-learn programming language. Because Java is also a computing platform, there are lots of applications and websites that will not work unless you have an implementation of Java Runtime Environment (JRE) installed.

To be able to code Java-based applications, a Java Development Kit (JDK) software bundle is required (see later). Eclipse IDE is a popular free IDE to write Java applications with.

Java was invented by James Gosling and developed by Sun Microsystems. Starting in 1991, a group of engineers called the “Green Team” worked tirelessly to create Java. Java is currently owned by the Oracle corporation.

JavaScript

JavaScript (abbreviated JS, first called ‘Mocha’) is a scripting language that was released in 1997. It was invented by Brendan Eich and became an ECMA standard in the same year it was released.

It is a useful object-oriented programming language. As a client-side scripting language, it is mainly used in combination with HTML and CSS on websites to create user interactivity. When compared with Java, JavaScript is considered to be easier to learn.

Although JavaScrip was initially written in 10 days, over the years it has come a long way to where it is today. Unlike Java applications, JavaScript does not need any (virtual) platform, other than a modern web browser to function. While a good IDE (e.g. Eclipse IDE and Aptana Studio) will help with writing code, it can be written and tested with any text editor and your web browser.

Lately, using Node.js, JavaScript is increasingly being used to create server applications and services. Node.js is a JavaScript Engine (almost like Java Runtime Environment).

Today, JavaScript is maintained by Mozilla (created by Netscape) and is owned by the Oracle Corporation.

Java Runtime Environment (JRE) vs. Java Development Kit (JDK)

The first important fork that one might encounter when it comes to Java is its packages. As mentioned earlier, one can either be an end-user of Java applications, or a Java developer.

Therefore Oracle has two Java packages that they maintain, namely the Java Runtime Environment (aka ‘Java’, JRE and JRE Standard Edition) for end-users and the Java Development Kit (JDK) for Java developers.

Java Runtime Environment (JRE)

Java is not only a programming platform. All applications written in Java need a virtual environment to function in. This is called the Java Virtual Machine (VM). Typically, such an environment (JRE) comes either pre-installed on devices running mainly Java applications or needs to be installed as a plug-in on devices when Java applications are installed in addition to other applications (e.g. a Windows operating system).

Windows, for example, does not come pre-installed with JRE, but MacOS apparently does.

Java.com main page

The latest recommended version of Java SE RTE can be downloaded from Java.com.

Without going into too many details, Java (JRE) SE 8 can be downloaded from Java.com.

The Raspberry Pi OS (formerly known as Raspbian), a Debian-based operating system, has OpenJDK installed by default (see Java JDK later in this post).

Java 8 vs. newer versions of Java

For most users, JRE is synonymous with ‘Java’ or ‘Java SE’. Although the latest version of JRE SE on Oracle.com is 13 (at the time of writing), the recommended version for regular end-users is version 8 (available from Java.com).

Some software applications might refer to Java 8 as version 1.8.0. According to a short archived discussion on the Oracle Community Directory, the reason for Java.com not featuring newer versions of Java is that “Java 8 is planned to be the long-term supported code line for end-user platforms — also referred to a long-term release or LTR).

Releases newer than 8 are planned to be for server and embedded developers”. At the time of writing, the latest patch update of Java 8 is 241 (released on 14 January 2020). Although JRE 8 would be enough for most users, the latest version can still be downloaded from the Java section of  Oracle.com instead.

Support for Java 8 is said to end on 31 December 2020 at which time Java 11 is the newest LTR.

Different Java editions (i.e. ME, SE and EE) are discussed later in this post.

Java patch updates

Apart from version releases (e.g. Java 8 vs. Java 9), each version of Java has patch updates. These are smaller updates that are indicated by u. (e.g. Java 8u240 to Java 8u241). As far as I understand, for example, Windows Auto Updates will only prompt for patch updates and not version releases.

Installed version(s) of Java

To see if you have Java on your Windows computer, and/or to see what architectural variations, versions and/or patch updates are installed, the Windows Control Panel Uninstall feature can be used.

Java in the Windows Control Panel

Windows 10 Control Panel Uninstall window. Note the different versions of Java. In this case, a 64-bit variation of the JDE 13 is installed. The other two versions, JDK 8 and JRE (shown as just Java 8) are 32-bit variations.

Multiple patch updates, versions and architectural variations of Java RTE can be installed on the same operating system. Sometimes this might be necessary (e.g. to have Eclipse IDE and Aptans Studio 3 installed on Windows), but otherwise, it is recommended to remove older versions (especially patch updates) if they are unused.

By uninstalling older versions, the performance, stability and security of the Java applications are improved. To uninstall a Java installation on Windows, the Control Panel Uninstall function or the Oracle Java Uninstall Tool can be used.

Oracle Java Uninstall Tool

The location on Java.com to access the Java Uninstall Tool.

To see what version of Java is used on Linux-based operating systems (e.g. the Raspberry Pi OS), the Java version or fullversion terminal command can be used from the CLI:

java -version

or

java -fullversion

Multiple versions of Java JDK (see later) can also be installed on these operating systems. To see if there are multiple versions installed, and to be able to choose which version needs to be used, update-alternatives terminal command can be used from the CLI:

sudo update-alternatives --config java

When multiple versions of Java RTE and JDK are installed, the entry can be chosen by choosing the number representing the version.

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-11-openjdk-armhf/bin/java      1111      auto mode
  1            /usr/lib/jvm/java-11-openjdk-armhf/bin/java      1111      manual mode
  2            /usr/lib/jvm/java-8-openjdk-armhf/jre/bin/java   1081      manual mode

Press <enter> to keep the current choice[*], or type selection number:

32-bit vs. 64-bit

For Windows users, the Java.com Java download page will direct most users to download links for the suitable architecture (32-bit or 64-bit) of Java SE. This choice is not only hardware and operating system dependent, but also browser dependent.

Because there are still some issues surrounding the ability and availability of 64-bit web browsers on Windows operating systems, Java.com recommends using the 32-bit version. Some 32-bit applications (e.g. Aptana Studio 3) will insist on the 32-bit variation to be installed. The same goes for 64-bit installations (e.g.the 64-bit variation of Eclipse IDE). To have manual control over which architecture is installed, the See all Java downloads link at the bottom of the Java.com download page can be followed.

Java.com see all Java downloads

The ‘See all Java downloads’ link is situated at the bottom of the Java.com download page.

Both the 32 and 64-bit architectural variations can be installed on the same Windows computer.

Java Development Kit (JDK)

The Java Development Kit (JDK) is the software bundle required to be able to code in Java. JDK supplies a list of classes, referred to as the Java application programming interface (API). Oracle strongly recommends using the term JDK to refer to the Java SE (Standard Edition) Development Kit.

Unlike with JRE (see earlier), JDK, which will include the same version of JRE, the latest version is recommended for up to date development. Apart from this, most of the architectural variations, patch updates and version notes mentioned for JRE apply to the JDK.

The latest version of JDK can be downloaded from the Java section of the Oracle.com website.

Oracle.com's Java downloads

The Jave SE Downloads section on the Java section of Oracle.com

New JDK license agreement

As of 16 April 2019, the Oracle JDK License agreement has changed. It is still free for personal and development use, but some uses authorized under prior Oracle JDK licenses may no longer be available. See the Oracle JDK licence terms and FAQs if you are unsure.

Oracle JDK vs. OpenJDK

Apart from the Oracle implementation of JDK, there is also an OpenJDK. The differences between these to implementations of the JDK are worth an entire post on their own, but the more noteworthy differences/similarities are as follows:

  • Oracle JDK is a commercial product with various licenses attached, whereas OpenJDK is an open-source project (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).
  • The OpenJDK is an official reference implementation of a Java Standard Edition since version SE 7.
  • Initially, OpenJDK was based only on JDK 7, but since Java 10, the open-source reference implementation of the Java SE platform is the responsibility of the JDK Project.
  • OpenJDK performs better on certain platforms, e.g. on a Raspberry Pi.

Some operating systems will come pre-installed with a version of JDK. For example, the Raspberry Pi OS is downloaded with OpenJDK pre-installed.

Java ME, SE, EE & FX platforms

Oracle has four Java programming language platforms. They are Java Micro Edition (Java ME), Java Standard Edition (Java SE), Java Enterprise Edition (Java EE) and JavaFX. All these Java platforms consist of a Java virtual environment (Virtual Machine, or VM) and Java API. See the Oracle documentation for more information.

Java SE

As one might think of a ‘standard edition’, Java SE provides core and standard functionality. The Java SE API provides the core functionality of the Java programming language. It provides everything from basic to high-level classes. Java SE is the most commonly used platform of Java.

Java EE

The Java EE platform is built on top of the Java SE platform. The Java EE platform provides an API and virtual environment for developing and running large-scale, multi-tiered, scalable, reliable and secure network applications.

Java ME

The Java ME platform provides an API and a small-footprint virtual machine for running Java programming language applications on small devices, like mobile phones. The API is a subset of the Java SE API, along with special class libraries useful for small device application development.

JavaFX

JavaFX is a platform for creating rich internet applications using a lightweight user interface API. JavaFX applications use hardware-accelerated graphics and media engines to take advantage of higher-performance clients and a modern look-and-feel as well as high-level APIs for connecting to networked data sources.

Installing the right version of Java (summary)

So after looking at all the different Java platforms in the form of versions, architectural variations, patch updates and editions, we can now finally have a better understanding of what ‘Java’ to install (or uninstall).

On Windows, the Control Panel Uninstall feature can be used to see what is already installed and/or to uninstall unnecessary versions. On Raspbain, CLI terminal commands to check and select Java versions are the java version and fullversion terminal commands:

java -version
java -fullversion

and the update-alternatives terminal command:

sudo update-alternatives --config java

For Java application users (vs. Java developers)

In summary, the first fork is to decide if you are a Java developer or a Java user. If you are a Java-based software user, then the choice is simple – grab a copy of the latest version of Oracle JRE 8 or 11. Sometimes specific software packages will require a specific or the latest version of Java. Also, remember that JRE is included in the JDK.

JRE 8 is available from Java.com and version 11 or later can be downloaded from the Java section of  Oracle.com. On the Raspberry Pi OS, only JDK can be installed. For the Raspberry Pi, there are two JDKs we can use: OpenJDK and Oracle JDK. They can all be installed by using terminal commands in the CLI as follows:

The latest version of OpenJDK (Raspberry Pi OS release dependant)

sudo apt install default-jdk

Version 8 of OpenJDK

sudo apt install openjdk-8-jdk

At the point of updating, higher versions of OpenJDK might have to be compiled yourself or the installation destination needs to be updated.

Version 8 of  Oracle JDK

sudo apt-get install oracle-java8-jdk

Conclusion

Java and JavaScript are different. Here the different Java platforms in the form of versions, architectural variations, patch updates and editions were pointed out.

Leave a Reply

Your email address will not be published. Required fields are marked *