Linux 从技术上讲,Oracle JDK 和 OpenJDK 之间的主要区别是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17360011/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Technically what is the main difference between Oracle JDK and OpenJDK?
提问by
I have been using OpenJDK for ages, initially for small projects where it has no problems. But since I started to play with it for big toys, I started to notice random/unknown fatal error and crashes (with H.264 codecs, etc.), and it was a nightmare till then to get ride of system crash+fatal errors caused by OpenJDK.
我已经使用 OpenJDK 多年了,最初是用于没有问题的小型项目。但是自从我开始用它玩大玩具后,我开始注意到随机/未知的致命错误和崩溃(使用 H.264 编解码器等),直到那时,系统崩溃+致命错误都是一场噩梦由 OpenJDK 引起。
After getting completely frustrated and tired with OpenJDK, I finally decided to switch into Oracle JDK 7. Since then my fatal errors/crashes were gone. I am still doing trace to see if it occurs, but I never got those system crashes yet.
在对 OpenJDK 感到完全沮丧和厌倦之后,我终于决定切换到 Oracle JDK 7。从那时起,我的致命错误/崩溃就消失了。我仍在跟踪以查看它是否发生,但我从未遇到过这些系统崩溃。
Now I am wondering, if OpenJDK is only a license issue, why is stability impossible with it?
现在我想知道,如果 OpenJDK 只是一个许可证问题,为什么它不可能稳定?
Why does OpenJDK keep bugs alive, inside their stable releases, but claiming that its clone of Oracle JDK (which it is not really), then what really technically separates OpenJDK from Oracle JDK? (only quick features availability? Or focused on stability/reliability?)
为什么 OpenJDK 在其稳定版本中保留错误,但声称它是 Oracle JDK 的克隆(实际上并非如此),那么从技术上讲,OpenJDK 与 Oracle JDK 的真正区别是什么?(只有快速功能可用性?还是专注于稳定性/可靠性?)
采纳答案by morgano
Technical differences are a consequence of the goal of each one (OpenJDK is meant to be the reference implementation, open to the community, while Oracle is meant to be a commercial one)
技术差异是每个目标的结果(OpenJDK 旨在成为参考实现,向社区开放,而 Oracle 旨在成为商业实现)
They both have "almost" the same code of the classes in the Java API; but the code for the virtual machine itself is actually different, and when it comes to libraries, OpenJDK tends to use open libraries while Oracle tends to use closed ones; for instance, the font library.
它们都具有“几乎”相同的 Java API 类代码;但是虚拟机本身的代码其实是不一样的,在库方面,OpenJDK倾向于使用开放库,而Oracle倾向于使用封闭库;例如, 字体库。
回答by User007
OpenJDK is a reference model and open source, while Oracle JDK is an implementation of the OpenJDK and is not open source. Oracle JDK is more stable than OpenJDK.
OpenJDK 是一个参考模型,是开源的,而 Oracle JDK 是 OpenJDK 的一个实现,不是开源的。Oracle JDK 比 OpenJDK 更稳定。
OpenJDK is released under GPL v2 license whereas Oracle JDK is licensed under Oracle Binary Code License Agreement.
OpenJDK 是根据 GPL v2 许可发布的,而 Oracle JDK 是根据 Oracle 二进制代码许可协议许可的。
OpenJDK and Oracle JDK have almost the same code, but Oracle JDK has more classes and some bugs fixed.
OpenJDK 和 Oracle JDK 的代码几乎相同,但是 Oracle JDK 有更多的类和一些错误修复。
So if you want to develop enterprise/commercial software I would suggest to go for Oracle JDK, as it is thoroughly tested and stable.
因此,如果您想开发企业/商业软件,我建议您选择 Oracle JDK,因为它经过全面测试且稳定。
I have faced lot of problems with application crashes using OpenJDK, which are fixed just by switching to Oracle JDK
我在使用 OpenJDK 时遇到了很多应用程序崩溃的问题,这些问题只需切换到 Oracle JDK 即可解决