Java versioning system has been a bit confusing with respect to updates and security releases till Java 8. All critical patches had been odd numbers and limited updates have been even numbered. This make it difficult to find out which version contains all the latest security fixes, for instance.

There were different ways to address a particular release name as well. JDK 8 Update 101, 1.8.0_101, jdk8u101 are different names used to address the same release for the particular JDK. Over a period of time, developers contributing to the language felt a need for a simple yet effective versioning scheme.

New Version-String Scheme

A JDK Enhancement Proposal (JEP 223) was created in 2014 to address these issues. This proposal suggests using a semantic versioning system which is explained here.

The version number will be a non-empty sequence of strings separated by dots. Although the string is going to be of arbitrary length, it contains essentially 3 main parts – major version number , minor version number and security – at the start of the string.

The first part is the major version number. This would refer to the main java release that we would normally refer to. The major version number for JDK 8 is 8, JDK 9 is 9 and so on. Whenever the major version number is incremented, all remaining elements are removed.

The second important part is minor version number. This would be maintenance releases for the major release which essentially contains bug fixes and revisions as per need.

The third important part is security. This is incremented when a security update is released. When a minor version number is incremented, this portion is not set to zero. Thus, a higher value of this portion of the JDK version always indicates a more secure major release regardless of the value of minor release. Thus, confusion created by previous versioning scheme is thinned out by the newly proposed versioning system.

The version number will be part of a version string. In addition to the version number, pre-release, build information and options string will also be part of the version string.

Consider the console output:

C:\Users\Matrix>java -version java version "9-ea" Java(TM) SE Runtime Environment (build 9-ea+172) Java HotSpot(TM) 64-Bit Server VM (build 9-ea+172, mixed mode) 1 2 3 4 C : \ Users \ Matrix > java - version java version "9-ea" Java ( TM ) SE Runtime Environment ( build 9 - ea + 172 ) Java HotSpot ( TM ) 64 - Bit Server VM ( build 9 - ea + 172 , mixed mode )

The major version number here is 9. Pre-release string is “ea” denoting that this is an early access version which is released before GA for testing by developer community. +172 denotes that the build is 172. Since GA is not done, the security and minor version numbers are not available.

There is a proposal to include Version in java.lang.Runtime in order to parse, validate and compare version strings. System properties are also modified to reflect the version changes. However, java.class.version remains unaffected.

Share this: Facebook

LinkedIn

Twitter

Tumblr

Pinterest



Like this: Like Loading...