Java version notation that changes in Java 10

(This article is a multipost with Go to the horizon)

Java has changed to a time-based release since version 10. Along with that, the version notation has changed again, so I have summarized it. [^ 1]

[^ 1]: But almost the same as Java 9

See JEP 322: Time-Based Release Versioning for details.

Version number

There are four notations: $ FEATURE. $ INTERIM. $ UPDATE. $ PATCH. Specifically, it is written as (The notation "Update up to Java 8" has disappeared)

meaning timing Next time Contents
$FEATURE Feature release Every six months March 2018 内容にかかわらずEvery six monthsにリリース
Feature additions, incompatible changes, feature removal[^del]including
$INTERIM Intermediate release no plan - Compatible bug fixes and enhancements[^enhancements]
(Does not include changes to standard API)
$UPDATE Update release 1 month after feature release, and every 3 months thereafter April 2018
July 2018
Security fix
Bug fixes for the latest features
$PATCH Patch release Only when needed - Minimal fix to solve a serious problem

[^ del]: In this case, it will be announced in at least the previous feature release. [^ enhancements]: It seems that it is supposed to be a case like JDK1.4.1, JDK1.4.2.

Detailed rules

--If all digits after a certain digit are 0, omit it. --Example: → 11 --Example: → 11.0.2 --If $ FEATURE, $ INTERIM is incremented, the numbers after that will be reset. --Example: 11.0.2 → → 11.1 → 11.1.1 --The following is given after the version number --Pre-release identifier (optional) --Example: 11.0.2-ea --Build number --Example: 11.0.2 + 13 --Optional information such as LTS (optional) --Example: 11.0.2 + 13-LTS

Programmatic acquisition

These can be obtained with each method of the Runtime.Version class.

jshell> Runtime.version().feature()
$1 ==> 10

jshell> Runtime.version().interim()
$2 ==> 0

jshell> Runtime.version().update()
$3 ==> 0

jshell> Runtime.version().patch()
$4 ==> 0

jshell> Runtime.version().pre()
$6 ==> Optional.empty

jshell> Runtime.version().build()
$5 ==> Optional[46]

jshell> Runtime.version().toString()
$7 ==> "10+46"

Is it newer than one version? Is it old? If you want to check, it is better to compare with the compareTo method than to compare one by one above.

jshell> Runtime.version().toString()
$1 ==> "10+46"

jshell> Runtime.version().compareTo(Runtime.Version.parse("10.0.1")) > 0
$2 ==> false

jshell> Runtime.version().compareTo(Runtime.Version.parse("9.0.1")) > 0
$3 ==> true

However, Runtime.Version is a class added in Java 9. Please note that if you need to support Java 8 or earlier, you can only get it from the system property java.version.

jshell> System.getProperty("java.version")
$4 ==> "10"

By the way

"Release date [^ 3]" and "Vendor version" have been added to the system properties. For the Oracle JDK, the vendor version seems to remain the originally planned release year.release month.

[^ 3]: To be exact, the GA date. So, the Eary Access version will have a future date.

jshell> System.getProperty("")
$1 ==> "2018-03-20"

jshell> System.getProperty("java.vendor.version")
$2 ==> "18.3"

Recommended Posts

Java version notation that changes in Java 10
Changes in Java 11
Java version notation comparison
Using JavaScript from Java in Rhino 2021 version
Changes in Mockito 2
Partization in Java
Changes in mybatis-spring-boot-starter 2.0
Changes in mybatis-spring-boot-starter 2.1
Changes in mybatis-spring-boot-starter 1.3
Java version check
Rock-paper-scissors in Java
Changes in mybatis-spring-boot-starter 1.2
Pi in Java
FizzBuzz in Java
Java that outputs vmg format file in eml format
Try using Sourcetrail (win version) in Java code
Try using Sourcetrail (macOS version) in Java code
A bat file that uses Java in windows
General-purpose StringConverter class that utilizes generics in Java8
[java] sort in list
Read JSON in Java
Interpreter implementation in Java
Make Blackjack in Java
Rock-paper-scissors app in Java
Constraint programming in Java
Put java8 in centos7
Changes from Java 8 to Java 11
NVL-ish guy in Java
Combine arrays in Java
"Hello World" in Java
Callable Interface in Java
Write a class that can be ordered in Java
Comments in Java source
Azure functions in java
Format XML in Java
Simple htmlspecialchars in Java
Boyer-Moore implementation in Java
Hello World in Java
Use OpenCV in Java
webApi memorandum in java
Switching java version (memorial)
Type determination in Java
Ping commands in Java
Various threads in java
Heapsort implementation (in java)
Zabbix API in Java
ASCII art in Java
[.net, Java integration] Nger that executes .jar in C # .net
Compare Lists in Java
This and that for editing ini in Java. : inieditor-java
[Java] Explains ConcurrentModificationException that occurs in java.util.ArrayList for newcomers
Express failure in Java
Create JSON in Java
Date manipulation in Java 8
What's new in Java 8
Changes in JUnit5M4-> M5
Use PreparedStatement in Java
What's new in Java 9,10,11
Parallel execution in Java
Initializing HashMap in Java