-->

What is the reason to use OpenJDK?

2020-03-01 09:28发布

问题:

I somehow understand the differences between Oracle JDK and Open JDK.
But I can't find reasons to use Open JDK.
Because Oracle JDK already has everything one would need and sometimes faster than Open JDK.

In which cases should someone use Open JDK?
Is it just for legality issues?
If yes, then what are issues?
That because I have been still develop all my projects using Oracle JDK

回答1:

November 2017: At the time this question was asked, the reasons for choosing between OpenJDK and Oracle JDK include:

  • Availability of builds / installers for specific platforms. For example, last time I checked there were no Oracle JDK distros in ".deb" format for Debian / Ubuntu. And no OpenJDK builds for Windows.

  • Oracle JDK has some commercial features that can be enabled by people who have paid. They are not present on OpenJDK.

  • Oracle JDK has an annoying click-through license. This is a pain if you are trying to automate deployment; e.g. to cloud VMs. By contrast, OpenJDK on Linux (at least) can be installed and updated using the platform's package manager.

  • There may be issues if you wanted commercial support for OpenJDK.

There were no substantive license differences between Oracle JDK and OpenJDK if you just plan to use the software. (There are some constraints on binary redistribution for Oracle JDK, but they are about shipping non-standard or stripped-down versions of the Java platform.)

In the future, some of these differences will go away, according to this blog page:

  • Faster and Easier Use and Redistribution of Java SE

Update in December 2018:

  • As of January 2019, Oracle JDK Java 8 will be EOL for commercial uses. (But free support will continue until January 2020 for personal use.)

  • Java 9 and Java 10 are EOL.

  • Commercial uses of Oracle JDK Java 11 and later require a support contract or a subscription from Oracle. OpenJDK Java builds do not have this requirement.

  • Oracle do not provide support for OpenJDK Java builds, but support is available from 3rd parties. Third parties will also port Oracle security fixes to OpenJDK builds.

Further reading:

  • Java Is Still Free
  • OpenJDK Life Cycle and Support Policy (RedHat)
  • The future of Java and OpenJDK updates without Oracle support
  • What has changed in Java Release and Update Availability? (Azul Systems)
  • AdoptOpenJDK Support


回答2:

OpenJDK comes tightly integrated with the distribution update process. For example, on Fedora, this means that you simply can run

dnf update

without activating third-party repositories, and you will get the latest OpenJDK version with all relevant fixes.

OpenJDK is tested by the distribution vendor on this particular distribution. Oracle has different reference platforms for testing of OpenJDK. In the case of Fedora, software written in Java is tested with the OpenJDK version provided by the distribution, while the combination of that software with Oracle JDK receives much less testing.

Oracle also bundles their Java downloads with additional software such as browser toolbars, performance measurement and monitoring tools.



回答3:

Other Answers are correct. Here is some other information as well, including vital changes as of late 2019.

Source-code versus Binaries/installers

understand the differences between Oracle JDK and Open JDK.

To sum it up: source-code versus binaries/installers.

  • OpenJDK is an open-source project, implementing the JS, JSRs, and JEPs. This project publishes only source-code, not binaries or installers to get Java running on your computer. Oracle is a key participant in the OpenJDK project, alongside IBM & Red Hat, Apple, SAP, Azul Systems, and others.
  • Many companies provide distributions of OpenJDK for installation, as binaries or installers. Oracle is one such company.

Oracle actually provides two such products:

  • Oracle JDK
    A commercial product, with paid support plans. (Free-of-cost only for development & testing, not deployment. Read their terms.)
  • jdk.java.net
    A build of the OpenJDK source-code, freely available, unsupported.

Oracle has declared their intention to keep their commercial product Oracle JDK at feature-parity with OpenJDK. Oracle even went so far as to open-source and make available at no cost their formerly commercial tools Mission Control and Flight Recorder, both now a part of OpenJDK. So there is nearly no practical difference. One significant difference is that the Oracle company reserves the right to rapidly supply their paid support customer base with urgent patches not currently found in OpenJDK. Ditto for other vendors selling support.

[And for the record, Oracle offers a third implementation of Java, GraalVM, which is a very specialized product.]

Here is a flowchart graphic I made to help guide you in selecting a provider of a Java implementation.

And here is a list of motivations you might consider in choosing a distribution.



回答4:

For those, who read this in 2019.

Java SE 8 is the last Java SE release targeting Desktop deployment (eg, Java Web Start and a stand-alone system JRE). Java SE 8 will be end of public updates in January 2019, after which commercial users need to either transition to other technologies, or purchase a Java SE Subscription.

So, another reason to use OpenJDK (in addition to what Stephen C said): it's free of charge for all purposes.