Java 版本控制和术语,1.6 与 6.0 OpenJDK 与 Sun
我在理解 Java 版本控制方面遇到问题。我看到了很多版本,例如 1.4.2、1.5 和 1.6,但我也偶然发现了 5.0 和 6.0。我不明白这个版本控制或进展。
我对 Java 还很陌生,我读过一些关于 OpenJDK 与 Sun 的内容,并且我想我明白了。这些版本是 OpenJDK 和 Sun 之间的区别吗?比如OpenJDK最新的是1.6,Sun的是6.0?
对于刚接触 Java 的人来说,所有这些版本都非常令人困惑。
I'm having problems understanding Java versioning. I'm seeing lots of versions like 1.4.2, 1.5 and 1.6, but I also stumble upon 5.0 and 6.0. I don't understand this versioning or the progression.
I'm pretty new to Java, and I've read a bit about OpenJDK vs Sun, and I think I understand it. Are these versions the difference between OpenJDK and Sun? For example, OpenJDK's latest is 1.6 and Sun's is 6.0?
All these versions are pretty confusing to someone new to Java.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
1.6 和 6 均用于引用相同的版本(1.5 和 5 也类似)。
Both 1.6 and 6 are used to refer to the same version (and similarly for 1.5 and 5).
Java 版本指南 是任何人的最佳博客新人了解 Java 版本控制
自 2019 年以来,Java 每 6 个月(即 3 月和 9 月)发布新版本。
现在是 2021 年 10 月,Java 17 已经发布。这是下载OpenJDK
几个值得注意的点
Guide to java versions is the best blog for any new person to understand java versioning
Since 2019, Java releases new version every 6 months, i.e. March and September.
It's October 2021, and Java 17 is already released. Here is the link to download OpenJDK
Couple of noteworthy points
唯一的区别是单位数字通常与 Java SE 5 和Java EE 6.
1.5 和 1.6 版本是 Java 编译器使用
java -version
,有时“次要版本”用作版本字符串,例如 SunOS 5.8 被称为 Solaris 8 作为产品名称。The only difference is the single digit numbers are usually used in conjunction with Java SE 5 and Java EE 6.
The 1.5 and 1.6 versions are what the Java compiler says using
java -version
and sometimes 'the minor release' is used as a version string, like SunOS 5.8 was called Solaris 8 as a product name.版本控制简直是一团糟:
java -version
的输出中消失(这导致一些依赖于解析它的代码被破坏)。请参阅JEP 223:新版本字符串方案。我们现在有 Java 15、Java 16、Java 17 等。请参阅 Java 版本历史记录 在维基百科中。
另请注意,当提出这个问题时,Sun JDK 和 OpenJDK 是独立的代码库(有很大重叠),并且 Sun JDK 是官方参考实现。
此后的十多年里,Java 被出售给 Oracle,OpenJDK 成为官方 Java 参考实现,Oracle 停止将 Oracle JDK 作为单独的代码库进行维护。相反,他们只是提供 OpenJDK 版本,并通过错误修复和安全补丁为其提供商业长期支持。但是您也可以从 AdoptOpenJDK(最近更名为 "Adoptium")免费获取构建版本,但它们并不是支持多久。
The versioning is simply a mess:
java -version
) eliminated the traces of the old versioning scheme, but people have gotten used to it and continue to use it colloquially.java -version
(which caused some code that depended on parsing it to break). See JEP 223: New Version-String Scheme.We now have Java 15, Java 16, Java 17, etc. See Java Version History in Wikipedia.
Note also that when this question was asked, Sun JDK and OpenJDK were separate codebases (whith a large overlap), and Sun JDK was the official reference implementation.
In the more than 10 years since then, Java was sold to Oracle, OpenJDK became the official Java reference implementation, and Oracle stopped maintaining the Oracle JDK as a separate codebase. Instead, they just provide OpenJDK builds and provide commercial long term support for them with bugfixes and security patches. But you can also get builds for free from AdoptOpenJDK (which recently rebranded as "Adoptium"), they just aren't supported as long.
Java SE 命名和版本对此进行了解释(咳):
并引用 Java SE 6 平台名称和版本号:
还有 J2SE 版本 1.5.0 或 5.0? :
所以,总而言之,整个命名是一团糟,但这最终是 ,当前的平台名称是 JavaTM Platform, Standard Edition 6(缩写为 JavaTM SE 6)。该平台下提供了两个产品:JDKTM 6 和 JRETM 6
。 java.net/projects/jdk6/" rel="noreferrer">OpenJDK 6 是 Java SE 6 平台的开源实现,它与 Sun 的 JDK 不同。
This is explained (cough) in Java SE Naming and Versions:
And quoting Java SE 6 Platform Name and Version Numbers:
And J2SE Version 1.5.0 or 5.0?:
So, to summarize, the whole naming is a mess but this is finally over and the current platform name is JavaTM Platform, Standard Edition 6 (abbrev. JavaTM SE 6). Two Products are delivered under the platform: the JDKTM 6 and the JRETM 6.
OpenJDK 6 is an open-source implementation of the Java SE 6 Platform, it's different from Sun's JDK.
基本上扔掉版本号的 1. 部分。
Basically throw away the 1. part of the version number.