Home  >  Article  >  Java  >  Is java open source?

Is java open source?

(*-*)浩
(*-*)浩Original
2019-05-31 11:26:077402browse

At the JavaOne conference on November 13, 2006, Sun announced that it would eventually open source Java, and in more than a year, it would gradually release various parts of the JDK under GPL v2 (GNU General Public License v2) The source code is disclosed under the agreement, and the OpenJDK organization is established to independently manage these source codes. Except for a very small amount of proprietary code (Encumbered Code, most of which Sun itself has no authority to open source), OpenJDK includes almost all the code of Sun JDK. The quality director of OpenJDK once said that in JDK 1.7, Sun Except for the copyright annotation in the code file header, the codes of JDK and OpenJDK are basically the same, so OpenJDK 7 and Sun JDK 1.7 are essentially products developed from the same code base.

Is java open source?

On November 13, 2006, Sun Microsystems officially open sourced Java. The fact that Java's source code was accessible on day one was a strategy that helped Java drive platform establishment in its early years.

James Gosling, the father of Java, said that their intention to open the source code is to allow the community to help with security analysis, bug reporting, performance enhancement, and understanding of remote cases. The original license used by Java allowed internal use of the source code but not distribution.

IBM called at the time to donate Java to the Apache Software Foundation and distribute it using the Apache license, but Sun ultimately decided to open source Java under the GPL license. The GPL license requires that derivative versions be publicly distributed. Gosling said this would allow Java to better adapt to the open source community. Sun was acquired by Oracle in 2010, and Java also fell into Oracle's hands, with Oracle leading the evolution of Java.

After the release of JDK 1.6, due to the increase in code complexity, JDK open source, development of JavaFX, economic crisis and Sun acquisition, Sun spent a lot of resources on things other than JDK development, and JDK updates were no longer available. Maintain the development speed of releasing one major version every two years. JDK 1.6 has released a total of 37 Update versions so far. The latest version is Java SE 6 Update 37, which was released on October 16, 2012.

OpenJDK was originally an open source version of the Java development environment (JDK) built by SunMicrosystems for the Java platform. It is completely free and open source. Sun Microsystems announced at the 2006 JavaOne conference that it would open source Java code and officially released OpenJDK on April 15, 2009. Oracle took over the project after acquiring SunMicrosystem in 2010.

Java is divided into openjdk and sun/oracle JDK during the release process.

The differences between JDK and OpenJDK can be summarized as the following points:

Differences in licensing agreements:

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

OpenJDK does not contain Deployment (deployment) function:

Deployment functions include: Browser Plugin, Java Web Start, and Java Control Panel, these functions are not found in Openjdk.

OpenJDK source code is incomplete:

It is easy to think of this. In Openjdk that adopts the GPL protocol, part of the source code of sun jdk cannot be opened to openjdk for use due to property rights issues. The most important one is Part is the code of the SNMP part of the optional component in JMX. Therefore, these source codes that cannot be opened will be made into a plug for use when compiling OpenJDK. You can also choose not to use plug. Icedtea has developed source code (OpenJDK6) with the same functions for these incomplete parts, making OpenJDK more complete.

Part of the source code is replaced with open source code:

Due to property rights issues, many source codes whose property rights are not SUN have been replaced with some open source codes with the same functions, such as font rasterization engines. Use Free Type instead.

openjdk only contains the most streamlined JDK:

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

Cannot use Java trademark:

This is easy to understand. On the machine where openjdk is installed, entering "java -version" displays openjdk, but if it is openjdk using the Icedtea patch, it displays is java. (Unverified)

In short, there are still many unfree elements in the Java system, and the development of source code is not thorough enough. I hope Oracle can make JCP more free and open. This is what all Java communities hope for. .

At this point, I basically understand why there is a dispute between open source and closed source in Java, and also understand the reasons for misunderstandings. I personally feel that Java is still open source, but the degree of open source is not 100%.

The JVM included in Oracle/Sun JDK is HotSpotVM. HotSpot VM only has a very, very small amount of functions that are not in OpenJDK, and that part is in Oracle's internal code base. None of these private parts touch upon the core functionality of the JVM. Therefore, Oracle/Sun JDK and OpenJDK actually use the same code base.

From the perspective of an internal Oracle employee, when he wants to build OracleJDK, he also needs to first check out OpenJDK from http://hg.openjdk.java.net, and then from the Oracle internal code base Check out the private parts, put them in a specific directory under the OpenJDK code, and build.

It is worth noting that Oracle JDK only releases binary installation packages, while OpenJDK only releases source code

The above is the detailed content of Is java open source?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:what is java fieldNext article:what is java field