有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

Java版本控制和术语,1.6 vs 6.0 OpenJDK vs Sun

我在理解Java版本控制方面遇到问题。我看到了很多版本,比如1.4.2、1.5和1.6,但我也偶然发现了5.0和6.0。我不理解这个版本或进程

我对Java相当陌生,我读过一些关于OpenJDKvs Sun的文章,我想我理解它。这些版本是OpenJDK和Sun的区别吗?例如,OpenJDK的最新版本是1.6,Sun的最新版本是6.0

对于Java新手来说,所有这些版本都非常混乱


共 (6) 个答案

  1. # 1 楼答案

    Guide to java versions 是任何新手了解java版本控制的最佳博客

    自2019年以来,java每6个月发布一次新版本,即3月和9月
    BR/>是2021年10月,java 17已经发布。以下是下载OpenJDK

    的链接,其中有几点值得注意

    1. 您可以始终使用最新版本的java,它将执行使用以前版本编写的代码
    2. 以前JRE和JDK是分开分发的,现在有只分发JDK的趋势
    3. 有两个发行版:OpenJDK(免费)和OracleJDK(付费)
  2. # 2 楼答案

    这在Java SE Naming and Versions中解释(咳嗽):

    The current release is Java Platform, Standard Edition 6 (Java SE 6). The previous release was Java 2 Platform, Standard Edition 5.0 (J2SE 5.0).

    Sun Microsystems simplified the platform name in 2006 to better reflect the level of maturity, stability, scalability, and security built into the Java platform. Sun dropped the "2" from the name and deleted the "dot number" (the number following the period). Any updates to Java platforms will simply be noted as updates rather than adding a "dot number" at the end of the platform name.

    Due to significant popularity within the Java developer community, the development kit has reverted back to the name "JDK" from "Java 2 SDK" (or "J2SDK"). The runtime environment has reverted back to "JRE" from "J2RE." (Note that "JDK" stands for "J2SE Development Kit" in version 5.0.)

    For more information on platform names and version numbers, see the following pages:

    并引用Java SE 6 Platform Name and Version Numbers

    At this release, the platform name has changed from J2SETM to JavaTM SE. The official name is JavaTM Platform, Standard Edition 6.

    Both version numbers (1.6.0 and 6) are used to identify this release of the Java Platform. Version 6 is the product version, while 1.6.0 is the developer version. The number 6 is used to reflect the evolving level of maturity, stability, scalability and security of Java SE.

    J2SE Version 1.5.0 or 5.0?

    Both version numbers "1.5.0" and "5.0" are used to identify this release of the Java 2 Platform Standard Edition. Version "5.0" is the product version, while "1.5.0" is the developer version. The number "5.0" is used to better reflect the level of maturity, stability, scalability and security of the J2SE.

    The number "5.0" was arrived at by dropping the leading "1." from "1.5.0". Where you might have expected to see 1.5.0, it is now 5.0 (and where it was 1.5, it is now 5).

    因此,总而言之,整个命名都很混乱,但这是finally over,当前的平台名称是JavaTMplatform,Standard Edition 6(缩写JavaTMSE 6)。两款产品在该平台下交付:JDKTM6和JRETM6

    OpenJDK 6是JavaSE6平台的开源实现,它不同于Sun的JDK

  3. # 4 楼答案

    版本控制简直一团糟:

    • Java 1.0和1.1是正常的
    • 后来出现了Java1.2,但你应该称之为“Java2,JDK1.2”
    • 这种情况一直持续到1.4版本(也有像1.4.2这样的小版本)
    • 下一个版本应该是“Java5.0”,但在文件名和URL中仍然到处都是“1.5”
    • 从Java 6开始,他们放弃了次要版本,并且大部分(但不是完全,请参见java -version的输出)消除了旧版本控制方案的痕迹,但人们已经习惯了它,并继续以口语方式使用它
    • 从Java9或Java10开始,1。X表示法也从java -version的输出中消失了(这导致一些依赖于解析它的代码中断),人们几乎已经停止使用它。我们现在有Java15、Java16、Java17等等

    还请注意,当提出这个问题时,Sun JDK和OpenJDK是独立的代码库(有很大的重叠),Sun JDK是官方的参考实现

    在此后的10多年里,Java被卖给了Oracle,OpenJDK成为了官方的Java参考实现,Oracle停止将Oracle JDK作为单独的代码库进行维护。相反,他们只是提供OpenJDK版本,并通过错误修复和安全补丁为其提供商业长期支持。但是你也可以从AdoptOpenJDK(最近更名为"Adoptium")免费获得构建版本,它们只是没有得到足够长的支持

  4. # 5 楼答案

    • Java1.5。x与Java5相同。x
    • Java1.6。x与Java 6相同。x

    基本上扔掉1。部分版本号

  5. # 6 楼答案

    唯一的区别是,一位数通常与Java SE5和Java EE6一起使用

    1.5和1.6版本是Java编译器使用java -version表示的版本,有时“次要版本”用作版本字符串,就像SunOS 5.8被称为Solaris 8作为产品名称一样