Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does Open JDK have to do with Oracle/Sun JDK?

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the relevant knowledge of "What is the relationship between Open JDK and Oracle/Sun JDK". In the actual operation process of the case, many people will encounter such a dilemma. Next, let Xiaobian lead you to learn how to handle these situations! I hope you can read carefully and learn something!

Background backtracking

The historical reason is that OpenJDK is an open source version of JDK released under the GPL license. At the time of JDK7, OpenJDK had become the backbone development for JDK7, and Sun/Oracle JDK7 was released on top of OpenJDK7, with most of the source code being the same, with only a few replaced. Published under the Java Research License (JRL). OpenJDK 6 is a fork of JDK7 and tries to remove new features from Java SE7 to make it as compliant as possible with Java6 standards.

Basic introduction to Oracle JDK

Oracle JDK uses a commercial implementation, of course,"identical" is based on components common to both, Oracle JDK will also have some Open JDK does not have, commercial closed source features, such as Java Flight Recorder from the port. It is expected that MissionControl will also be available in Oracle JDK proprietary, closed-source form after migration to HotSpot.

Oracle jdk version display form java version "1.8.0_91"Java(TM) SE Runtime Environment (build 1.8.0_91-b14)Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode) Basic introduction to Open JDK

Open JDK uses the open-source FreeType. Open JDK is a project formed by Sun in late 2006 to open source Java, where "open source" is the usual open source form, that is, the source code can be reused, such as IcedTea, UltraViolet are distributions derived from Open JDK source code.

OpenJDK version display form [root@localhost ~]# java -versionjava version "1.6.0_39"OpenJDK Runtime Environment (IcedTea6 1.13.11) (rhel-1.13.11.0.el5_11-x86_64)OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode) Relationship between Open JDK and Oracle JDK

Linux people should know that in most LINUX distributions, if JDK is installed built-in or through a software source, it is installed OpenJDK, so what exactly is OpenJDK, and what is its relationship and difference with Oracle JDK?

Oracle project release manager Joe Darcy's introduction to the relationship between the two at OSCON 2011 also confirmed that OpenJDK 7 and Oracle JDK 7 are very close in terms of program, and the two share a lot of the same code (as shown in the figure below, note that the proportion of common code between the two is much higher than the proportion seen on the graph), so our compiled OpenJDK can basically be considered to be consistent with the official Oracle JDK in terms of performance, functionality and execution logic.

Different licensing agreements

OpenJDK is released under GPL V2, while JDK is released under JRL. Although both are open source, the difference in usage is that GPL V2 allows commercial use, while JRL allows only personal research.

Oracle/Sun JDK is licensed for commercial use under the Sun Community Source License (SCSL). The Java Research License (JRL) was introduced in 2004, with the release of Sun JDK6, well before JDK7.

OpenJDK contains only the most compact JDK

OpenJDK does not contain other packages, such as Rhino Java DB JAXP…, and packages that can be separated are also separated as much as possible, but most of these are free software, you can download them yourself.

OpenJDK source code incomplete

It is easy to think that in OpenJDK using the GPL protocol, part of the source code of SUN JDK cannot be opened to OpenJDK because of property rights issues, and the most important part is the code of the SNMP part of the optional component in JMX.

So this source code that can't be opened makes it into a plug for OpenJDK compilation, or you can choose not to use a plug. Icedtea has developed source code (OpenJDK6) for these incomplete parts, which makes OpenJDK more complete.

Relationship between OpenJDK and IcedTea

The IcedTea project was originally created because OpenJDK was incomplete (due to obstacles caused by property rights), and the community needed a complete open source tool chain and code base.

IcedTea has long been a set of patches for OpenJDK, and as I said earlier, it has a patch based on "./ different build systems for "configure."

In OpenJDK, we have replaced the encoded code, so there are no more obstacles. Because of our efforts, the IcedTea project has reduced the number of patches used.

One of the nice things about IcedTea is that its configure script makes it easy to build OpenJDK in a variety of different modes, such as using Zero Assembler Port to support compilation on non-x86/sparc chips, etc.

One big piece of content IcedTea offers is plugin/java-web-start infrastructure.

Part of the source code replaced with open source code

Due to proprietary issues, much of the SUN JDK source code has been replaced with open source code with the same functionality, such as the font rasterization engine, using Free Type instead.

Java trademarks cannot be used

This is easy to understand, on machines with OpenJDK installed, typing "java -version" shows OpenJDK, but if OpenJDK uses the Icedtea patch, java is displayed. (Not verified)

OpenJDK does not include Deployment functionality:

Deployed features include Browser Plugin, Java Web Start, and Java Control Panel, features not found in OpenJDK.

In terms of code integrity:

Sun/Oracle JDK > SCSL > JRL > OpenJDK

Sun/Oracle JDK has a small amount of code that is completely undeveloped, even in the SCSL version. This code is very rare.

SCSL code has more content in the closed directory than JRL.

JRL has more content than OpenJDK that is license-bound and cannot be opened as GPLv2.

But starting with Oracle JDK7/OpenJDK7, the material differences between the closed-source and open-source versions are very, very small. Rather than calling OpenJDK7 an "incomplete JDK," Oracle JDK7 builds on OpenJDK7 with a few value-adds, many of which are useless (such as browser plugins).

Personal analysis and understanding:

JDK has two names, early called Sun JDK, now called Oracle JDK, in fact, are the same thing. But this statement is not necessarily accurate, because OpenJDK is also called Oracle OpenJDK.

However, the simplest and most straightforward understanding is also personal understanding: OpenJDK is the open source code of JDK, not all of it, because in the JDK part, there are some Oracle non-open source, and there are some historical reasons.

Relationship between OpenJDK and IcedTea

The IcedTea project was originally created because OpenJDK was incomplete (due to obstacles caused by property rights), and the community needed a complete open source tool chain and code base. IcedTea has long been a set of patches for OpenJDK, and as I said earlier, it has a patch based on "./ different build systems for "configure." In OpenJDK, we have replaced the encoded code, so there are no more obstacles. Because of our efforts, the IcedTea project has reduced the number of patches used. One of the nice things about IcedTea is that its configure script makes it easy to build OpenJDK in a variety of different modes, such as using Zero Assembler Port to support compilation on non-x86/sparc chips, etc. One big piece of content IcedTea offers is plugin/java-web-start infrastructure.

"What is the relationship between Open JDK and Oracle/Sun JDK" is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 206

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report