哪个免费版本的 Java 可以用于生产环境和商业目的?

当我在目前的工作中处理一个 dockerization 项目时,我产生了一个疑问: 我可以使用哪个 Java?

这种怀疑是由于:

java download alert

因此,经过一些研究,我得出了以下结论:

  • 自从 Java8在 2019年04月16日8u221上更新以来,所有版本和更新(Java8、9、10、11和13)对于 个人使用和发展目的都没有成本 只是。任何其他用途,都需要 营业执照
  • 7之前的遗留版本,没有也不会有任何更新。如果遗留系统支持需要这些版本中的更新,那么销售联系人可能是一个解决方案。
  • 如果我想为 商业目的免费使用 Java8 Oracle 版本,我需要使用以前版本的 2019年4月16日8u221更新

问题

根据我的结论:

  • 如果我的开发严格需要或者是用 JDK 8开发的,那么我是否只能在 免费商业用途中使用 OracleJavaSE8JDK 8u202和更早的版本来接受问题和安全问题?

  • 如果我可以改变我的发展 还有我想仍然 免费还有我想有改进和安全更新,我必须使用这些 Java 开放实现之一?


参考文献

102725 次浏览

Oracle made a number of significant changes to how the Java platform is developed, distributed and updated at the same time as the launch of JDK 9.

The key facts to answer your questions are these:

  1. Oracle was using the Oracle Binary Code License (OBCL) for Java. This had field of use restrictions (you needed a commercial license for embedded use) but granted free use of the Oracle JDK for general purpose development and deployment.
  2. As of JDK 11, the license changed to the Oracle Technology Network License Agreement (OTNLA), which requires you to purchase a Java SE Subscription for use in commercial production. This license has also been applied to updates of JDK 8 since April (update 211/212).
  3. As of JDK 11, Oracle eliminated all functional differences between the Oracle JDK and a binary built purely from the OpenJDK source code. The important things no longer in the Oracle JDK 11 are the browser plugin, Java Web Start and JavaFX.
  4. You can continue to use any public Oracle binaries of JDK 7 (and earlier) in production without the need for a Java SE subscription, as the license is still the OBCL (it has not been changed retrospectively). You can also, as you say, use JDK 8 up to update 202 under the OBCL without cost.
  5. There are several options for continuing to use JDK 8 with updates for free. One of those is Zulu Community from Azul (who I work for). This is a free, TCK-tested binary with a couple of additional backported features (TLS 1.3 and Java Flight Recorder). Since this passes the TCK, from a functional perspective, it is identical to the Oracle JDK. Unless you are using Applets or Web Start your applications will work in the same way as with the Oracle JDK.
  6. If you want to move to JDK 11 (the current long-term support release, as defined by Oracle but followed by all other JDK providers), then you will need to choose one of the free distributions (like Zulu Community).

It is highly recommended to ensure your JDK is up to date and contains all relevant security patches. Continuing to use an older version could expose you to significant security exploits.

Update 2021-09

On my first reading, it appears this new license makes production use free-of-cost (along with dev, test, and training usages), except for products sold for a fee while bundling the Oracle JDK product. But I am not an attorney, so read the terms yourself and consult legal advice as needed.

Keep in mind that many other vendors continue to provide implementations of the Java specs, as shown in the flowchart below. Some of these vendors sell support plans, either optionally or as a requirement for use of their product. Never assume, always read the detailed requirements for any distribution you obtain.

Another 2021 update: Add Microsoft to the list of vendors seen below.


Several vendors offer a choice of Java implementations

The Answer by Speakjava is correct and informative.

In addition, here is a flowchart I made to guide you in choosing a vendor for a Java implementation.

Flowchart guiding you in choosing a vendor for a Java 11 implementation

Or another way to view this: Your particular motivations or situation.

Motivations in choosing a vendor for Java

Licences OTN vs BCL

Oracle JDK 8 (aka 1.8) no longer uses BCL (Binary Code License). From April 16, 2019, Oracle JDK 8 uses the OTN (Oracle Technology Network) license, which requires you to create an Oracle account to download JDK 8 and payment!!

BCL = Oracle Binary Code License

  • You can use it, but you can't modify it
  • You agree not to sue Oracle if anything goes wrong
  • You can redistribute/publish it (so that you can sell products with Java embedded), but if you do, you agree to indemnify Oracle; so if someone sues you, you can't drag Oracle into it.

It's really just there to protect Oracle's intellectual property and to shield them from being sued when bugs are found.

source: https://www.quora.com/In-short-what-does-the-Oracle-Binary-Code-License-Agreement-for-Java-SE-actually-say-or-prohibit/answer/Jon-Harley

As a summary: FREE with risks and without any fault of Oracle

OTN = Oracle Technology Network License

As a summary: Opposite to BCL and FREE just for development in your laptop. For enterprises, you must PAY

FREE with risks: Java 1.4, 5, 6 and 7

Oracle does not show any message related to license changes for Java 1.4, 5, 6 and 7 downloads. So we can use them for development and production deployment, accepting issues and security problems.

Legacy versions prior to 7, does not have and will not have any update. Maybe a sales contact could be a solution if your have a Legacy Systems running over this java old versions.

FREE with risks: Java 8 update 202

Just Java SE 8 JDK 8u202 and earlier versions are free for development and production deployment. You can download it from:

NOT FREE anymore but safe: Java 8 update 221

Since the java 8 update at April 16, 2019 8u221, all versions and updates for (java 8,9,10,11,14) has no cost just for personal use and development purposes. Any other use, needs a Commercial License.

FREE and safe : OpenJDK 8

AdoptOpenJDK uses infrastructure, build and test scripts to produce prebuilt binaries from OpenJDK™ class libraries and a choice of either OpenJDK or the Eclipse OpenJ9 VM.

All AdoptOpenJDK binaries and scripts are open source licensed and available for free.

OpenJDK is a ORACLE initiative. More details here: https://adoptopenjdk.net/

compressed mode

You can download the latest v8 release from here. Latest version:

Follow this to download using curl

install mode

apt-get install openjdk-8-jre (just run apps)
apt-get install openjdk-8-jdk (develop and run)

From https://openjdk.java.net/install/

FREE and safe : Zulu Community (Java 6,7,8,11,13,14,15)

Zulu Community Downloads:

FREE and safe : OpenJDK (Java 8,9,10,11,12,13,14)

Free and Open Source

The following implementations, listed in alphabetical order, are open source and free to use:

  • AdoptOpenJDK
  • Amazon Corretto
  • Azul Zulu
  • Bck2Brwsr
  • CACAO
  • Codename One
  • DoppioJVM
  • Eclipse OpenJ9
  • GraalVM CE
  • HaikuVM
  • HotSpot
  • Jamiga
  • JamVM
  • Jelatine JVM
  • Jikes RVM (Jikes Research Virtual Machine)
  • JVM.go
  • leJOS
  • Maxine
  • Multi-OS Engine
  • RopeVM
  • uJVM

Source: https://www.baeldung.com/oracle-jdk-vs-openjdk

Proprietary Implementations

There are also other private or commercial implementations:

  • Azul Zing JVM
  • CEE-J
  • Excelsior JET (Discontinued)
  • GraalVM EE
  • Imsys AB
  • JamaicaVM (aicas)
  • JBlend (Aplix)
  • MicroJvm (IS2T – Industrial Smart Software Technology)
  • OJVM
  • PTC Perc
  • SAP JVM
  • Waratek CloudVM for Java

Source: https://www.baeldung.com/oracle-jdk-vs-openjdk

Oracle Java 9 and 10 : Deprecated

Oracle Java 9 and 10 has reached end of support.


More References

Starting JDK 17 (September 2021)

Oracle JDK 17 and later are provided under a free-to-use license that lasts until one year after the subsequent LTS release. After that time, the Oracle JDK becomes under OTN license.

Here's a related FAQs page that explains more, but here's a summary extracted from that page:

"Oracle will use the NTFC for JDK 17 and later releases. LTS releases, such as JDK 17, will receive updates under this license for one year after the release of the subsequent LTS. After the free use license period, Oracle intends to use the OTN License, the same currently used for Java 8 and 11 LTS releases, for subsequent updates. Non-LTS releases such JDK 18 will be available for their entire planned six months support life under the NFTC."

Sources:

https://blogs.oracle.com/java/post/free-java-license

https://www.oracle.com/uk/java/technologies/javase/jdk-faqs.html

Now,You can use JDK/Java 17, in JDK/java7 download page(https://www.oracle.com/java/technologies/downloads/) ,you can get this comment:

Java 17 LTS is the latest long-term support release for the Java SE platform. JDK 17 binaries are free to use in production and free to redistribute, at no cost, under the Oracle No-Fee Terms and Conditions License.

JDK 17 will receive updates under these terms, until at least September 2024.