-1

I am trying to understand the output given by java --version command.

This link How to interpret this output from java --version explains all the aspects except the part - build 11.0.11+9-LTS-194, mixed mode

My question is :

  1. What is the build number indicates here ?
  2. If we want to know the version number for running JRE , can we just ignore this build number ?
  3. Can two JRE versions have same build number ?
Atul
  • 1,560
  • 5
  • 30
  • 75

1 Answers1

1
  1. The build number indicates how often that specific version of the JDK has been built (on the build server) at the time it was released. It starts over at one (1) when the builds for a new (patch-) release start.

  2. Depends on what you want to know. If you want to know whether you are running Java 11, Java 17 or something else then only the first number (11, 17) is relevant. If you want to know whether you are using a JDK with the latest security patches then the first three parts (11.0.11, 17.0.7) are relevant. If you want to know the exact version then everything is important.

  3. Yes, since these numbers start at one (1) with every patch release. For example, the Adoptium release archive lists the following versions:

  • jdk-11.0.19+7
  • jdk-11.0.17+8
  • jdk-11.0.16+8
  • jdk-11.0.13+8
  • jdk-11.0.12+7

As you can see there are multiple releases that have a build number 7 and also multiple release that have a build number 8. This is expected.


What does the following output mean?

java version "11.0.11" 2021-04-20 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.11+9-LTS-194)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.11+9-LTS-194, mixed mode)

According to JEP 322: Time-Based Release versioning it means:

  • Java version 11.0.11 (i.e. Java Feature version 11 - most often just called Java 11, patch level 11), Build Number 9 (released in April 2021)
  • the vendor-specific version is 18.9 (whatever that means depends upon the vendor of your specific JDK but doesn't change the fact that you are running Java 11)
Thomas Kläger
  • 17,754
  • 3
  • 23
  • 34
  • @user16320675 they are also reset every time the patch number is increased (https://github.com/openjdk/jdk11u/tags, https://github.com/openjdk/jdk17u/tags) – Thomas Kläger Jun 26 '23 at 07:29
  • To be more clear , if we get below output : Java(TM) SE Runtime Environment 18.9 (build 11.0.11+9-LTS-194), can we say that , my machine runs JRE version 18.9 ? Build number being irrelevant – Atul Jun 26 '23 at 09:29
  • 1
    @Atul that "18.9" is [an implementor specific version string](https://openjdk.org/jeps/322#System-properties) and can be anything - it doesn't help in deciding which Java feature version you are running – Thomas Kläger Jun 26 '23 at 11:18