Build Number in java –version output 在Java的–version输出中的构建版本号

huangapple go评论62阅读模式
英文:

Build Number in java --version output

问题

我正在尝试理解java --version命令给出的输出。

这个链接如何解释来自java --version的输出解释了除了build 11.0.11+9-LTS-194, mixed mode部分之外的所有方面。

我的问题是:

  1. 这里的构建号表示什么?
  2. 如果我们想知道运行的JRE版本号,我们可以忽略这个构建号吗?
  3. 两个JRE版本可以具有相同的构建号吗?
英文:

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 ?

答案1

得分: 1

  1. 构建号表示在发布时,特定版本的JDK在构建服务器上构建了多少次。当新的(补丁)版本开始构建时,它从一(1)重新开始。

  2. 取决于你想知道什么。如果你想知道你是否在运行Java 11、Java 17或其他版本,那么只有第一个数字(11、17)是相关的。如果你想知道是否使用了带有最新安全补丁的JDK,那么前三部分(11.0.11、17.0.7)是相关的。如果你想知道确切的版本,则一切都很重要。

  3. 是的,因为这些数字在每个补丁发布时都从一(1)开始。例如,Adoptium发布存档列出了以下版本:

  • 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

正如你可以看到,有多个版本的构建号都是7,也有多个版本的构建号都是8。这是正常的。

根据JEP 322:基于时间的发布版本的描述,以下输出意味着:

  • Java版本为11.0.11(即Java特性版本11,通常称为Java 11,补丁级别11),构建号为9(于2021年4月发布
  • 供应商特定版本为18.9(具体意义取决于你具体的JDK供应商,但不改变你正在运行Java 11的事实)
英文:
  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)

huangapple
  • 本文由 发表于 2023年6月26日 13:55:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/76553858.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定