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.
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.
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)