I understand differences btw Oracle Jdk, OpenJdk, AWS Corretto.
I know AWS team maintains Corretto, gives long term support for free but OpenJDK also has LTS support (8, 11, 17, ..) so other than Amazon adding fixes faster, I see no other benefit in Corretto.
If both OpenJdk and Corretto provide LTS, what is the point of using Corretto?
UPDATE
https://github.com/corretto gave me answers regarding the versioning confusion I had.
but OpenJDK also has LTS support (8, 11, 17, ..)
Be careful with your use of names here.
OpenJDK is the name of an open-source project. That project implements the Java specifications published by Oracle. The OpenJDK project is owned by Oracle Corp but enjoys the contributions of code and labor by IBM, Apple, and other companies and individuals.
The OpenJDK project provides only source code. For executable builds of that software, and installers for that software, you must look elsewhere. Several vendors offer binaries and installers.
The confusion comes from the fact that Oracle Corp legally allows vendors to use the word “OpenJDK” in the name of their JDK products. This naming represents the fact that their product is based largely (if not entirely) on the OpenJDK source code.
what is the point of using Corretto
You have a choice of obtaining a JDK (implementation of the Java specs) from several vendors. You may have various reasons motivating your choice. One reason might be the possibility of purchasing a support plan. Another reason might be needing an implementation for a particular less-common platform. Another reason might be convenience, or familiarity with the vendor.
Some folks choose AWS Corretto because they intend to deploy on AWS cloud. Amazon promises to keep Corretto as close as is practicable to the same as what executes on the AWS cloud.
Why is Corretto so behind given that OpenJDK LTS is 17 and Correto is based on OpenJdk 11?
As explained well in the Answer by dave_thompson_085, your understanding of those versions is incorrect.
Amazon maintains releases of Corretto for all three long-term support (LTS) versions of Java: 8, 11, and 17. Amazon also has a release for the current version of Java, 19.
The version number of each Corretto release corresponds with the version of Java specs being implemented, as noted on their GitHub site.
Amazon Corretto currently provides 8 11 and 15 to 19 (including 17). More completely it follows Oracle and (at least most) other OpenJDK packagers by supporting designated LTS versions 8 11 17 long-term, but non-LTS versions only for a limited period (so 15 and 16 should go away soonish as 20 and 21 are added). Major version 11 was initially released in 2018 but the most recent maintenance aka patch version of 11 from Corretto is 11.0.17.8.1 just a few months ago, approximately the same as Oracle (my current Oracle 11 identifies as 11.0.17+10-LTS-269).
I am working on migrating my java application from Oracle JDK to adoptOpenJdk.So what changes would be required to migrate to AdoptOpenJdk.
Feature parity
Oracle has committed to keeping their Oracle JDK product at feature parity with the codebase in the OpenJDK project. So any Java app running on Oracle JDK should run on any other platform built faithfully from the OpenJDK codebase. You need not make any changes to your Java programming.
Be aware that OpenJDK only provides source code. For binaries and installers, you must look elsewhere. Several companies provide such binaries and installers. One of those is a joint venture known as AdoptOpenJDK. Others include Azul Systems, Red Hat/IBM, SAP, BellSoft, Amazon, Oracle, and Pivotal.
Most of the vendors, including Oracle, provide JVMs using the HotSpot optimizing compiler and runtime. AdoptOpenJDK (at least) offers you a choice to obtain a build using the OpenJ9 optimizing runtime instead. Your Java app should run well on either HotSpot or OpenJ9, but you may see a different performance profile.
See my Answer to a similar Question.
Be aware that the current licensing terms for the Oracle JDK product require that for use in production you must pay a fee. That product is free-of-cost only for non-production use such as development and testing. If you do not want to pay such a fee to Oracle, use their unsupported product at JDK.java.net, or use a JVM provided by one of the other vendors as shown in this flowchart.
While I was in a dockerization project in my current job, I got this doubt: Which Java can I use?
This doubt is due to :
So after some researches I got these conclusions:
Since the Java 8 update at April 16, 2019 8u221, all versions and updates for (Java 8, 9, 10, 11 and 13) has no cost just for personal use and development purposes. Any other use, needs a Commercial License
Legacy versions prior to 7, does not have and will not have any update. Maybe a sales contact could be a solution if an update in these versions are required for Legacy Systems Support.
If I want to use Java 8 oracle version for commercials purposes and FREE, I need to use a previous version of April 16, 2019 8u221 update
Questions
According to my conclusions:
If my development strictly needs or was developed with JDK 8, Can I only use Oracle Java SE 8 JDK 8u202 and earlier versions for FREE and commercial purposes accepting issues and security problems?
If I can change my development and I want still FREE, and I want to have improvements and security updates, I must use one of these java open implementations?
References
End of Public Updates for Oracle JDK 8
The Oracle JDK License has changed for releases starting April 16, 2019.
Official List of updates and release versions
Java official supported versions
Oracle Java 8 download alert
Oracle Java 8 unsupported but free version
Java 4 legacy official download page
Java 5 legacy official download page
Java 6 legacy official download page
Java 7 legacy official download page
Update 2021-09
For versions 8 through 16, Oracle required a fee if their own Oracle JDK product was used in production, but not for dev, test, and training usages.
For Java 17, the Oracle JDK product is available under a new
No-Fee Terms and Conditions license, discussed on the Oracle
company blog.
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.
Or another way to view this: Your particular motivations or situation.
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:
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.
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).
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.
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.
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.
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.
Summary
If you need to have java in your production servers for free, your have two options
#1 OpenJdk
The OpenJDK is the open source reference implementation of the Java SE Specification, but it is only the source code https://github.com/openjdk
Binary distributions are provided by different vendors for a number of supported platforms.
One of them is https://jdk.java.net/java-se-ri/19 which is maintained by Oracle:
Source: https://whichjdk.com
#2 Customized by Third Parties
Amazon Corretto
https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/downloads-list.html
Zulu
https://www.azul.com/downloads/zulu-community/?architecture=x86-64-bit&package=jdk
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
OpenJDK and Oracle JDK
Both OpenJDK and Oracle JDK are created and maintained currently by Oracle only.
OpenJDK and Oracle JDK are implementations of the same Java specification passed the TCK (Java Technology Certification Kit).
Most of the vendors of JDK are written on top of OpenJDK by doing a few tweaks to [mostly to replace licensed proprietary parts / replace with more high-performance items that only work on specific OS] components without breaking the TCK compatibility.
Source: Differences between Oracle JDK and OpenJDK
Free official options
Here I will list and keep updated the official links, ready to download the most used java versions
Openjdk 19
https://jdk.java.net/java-se-ri/19
Openjdk 17
https://jdk.java.net/java-se-ri/17
Openjdk 11
https://jdk.java.net/java-se-ri/11
apt-get update
apt-get install openjdk-11-jdk
Oracle 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:
https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html
Openjdk 8 (Deprecated)
OpenJDK is a ORACLE initiative. More details here: https://adoptopenjdk.net/
compressed mode
You can download the latest v8 release from here. Latest version:
https://github.com/AdoptOpenJDK/openjdk8-upstream-binaries/releases/download/jdk8u292-b10/OpenJDK8U-jdk_x64_windows_8u292b10.zip
https://github.com/AdoptOpenJDK/openjdk8-upstream-binaries/releases/download/jdk8u292-b10/OpenJDK8U-jdk_x64_linux_8u292b10.tar.gz
I can't find the version for osx :(
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/
Oracle Java 1.4, 5, 6 and 7 (Deprecated)
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 because these versions are so ancient!!
Oracle downloads:
https://www.oracle.com/java/technologies/java-archive-javase-v14-downloads.html
https://www.oracle.com/java/technologies/java-archive-javase5-downloads.html
https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html
https://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html
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 From Trusted Third Parties
Zulu Community (Java 6,7,8,11,13,14,15)
https://www.azul.com/downloads/zulu-community/?architecture=x86-64-bit&package=jdk
Amazon Corretto (Java 11)
https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/downloads-list.html
Eclipse OpenJ9
https://www.eclipse.org/openj9/
More third parties
The following implementations, listed in alphabetical order, are open source and free to use:
AdoptOpenJDK
Azul Zulu
Bck2Brwsr
CACAO
Codename One
DoppioJVM
GraalVM CE
HaikuVM
HotSpot
Jamiga
JamVM
Jelatine JVM
Jikes RVM (Jikes Research Virtual Machine)
JVM.go
leJOS
Maxine
Multi-OS Engine
RopeVM
uJVM
NON-FREE options
You should pay for these versions but in return you will have a lot of features suported by Oracle or another third parties
Oracle Java
https://www.oracle.com/java/technologies/downloads/
Java 19
https://www.oracle.com/java/technologies/downloads/#java19
Java 17
https://www.oracle.com/java/technologies/downloads/#java17
Java 11
https://www.oracle.com/java/technologies/downloads/#java11
Oracle 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.
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html latest update 251
https://www.oracle.com/java/technologies/javase/javase8u211-later-archive-downloads.html previous updates (241,231,221,212,211)
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
Notes
Oracle Java 9 and 10 has reached end of support.
https://stackoverflow.com/a/50333498/3957754
More References
Differences between Oracle JDK and OpenJDK
https://whichjdk.com/
https://www.openlogic.com/blog/java-experts-openjdk-vs-oracle-jdk
https://www.oracle.com/technetwork/java/javase/overview/faqs-jsp-136696.html
https://www.oracle.com/downloads/licenses/javase-license1.html
https://openjdk.java.net/projects/jdk8/
https://www.oracle.com/java/technologies/javase/8u-relnotes.html
https://gist.github.com/jrichardsz/83db09163ca9a0db4c9cd4f91cbf0598/
https://jdk.java.net/archive
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 OpenJDK releases are under GNU GPL v2 with the Classpath Exception (permits free production use).
Oracle JDK 17 and later is available under the Oracle No-Fee Terms and Conditions License which permits free use for all users.
Previous Oracle JDK releases remain under the OTN License Agreement for Java SE.
"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.
I have a web application that uses embedded Tomcat, which I'll distribute as a desktop app. Since I don't want users to deal with the installation of JRE, I decided to bundle JRE in my installation package, however, I was wondering if there's a reduced version of JRE in order of having a smaller installation file size. For example, I removed all the CORBA related files from JRE and everything seems to be working fine, so I guess some other files could be removed without affecting Tomcat's functionality, but I really don't know which other files should I remove.
If anyone has done this before, I'd appreciate your comments.
AFAIK, there aren't any official cut-down Oracle JRE releases. Certainly not free ones, though I imagine Oracle would create one for a customer who was willing to pay (enough).
If you created and distributed a cut-down JRE based on the Oracle JRE, it would be a violation of the Java Binary license ... which expressly forbids such things. You would need to get permission from Oracle to do this. The same applies to other suppliers, so the chances of you finding a free cut-down JRE based on OpenJDK are "vanishingly small".
I'm don't know for sure the legal constraints on building a cut-down JRE starting from the OpenJDK open-source codebase. I suspect that it is legal from the copyright perspective, but that you need to understand of patent and trademark issues. (For example, a cut-down JRE would not pass Java Standard Edition TCK testing, so you would not be permitted to use trademarked terms like Java and JRE to describe it.)
You should to talk to a lawyer if you intended to build and distribute cut-down JREs to anyone else.
I understand that Azul distributes cut-down JREs as a commercial (non-free) offering. Google found this for me:
The short answer for why we do not remove contents of Zulu JDK is for compliance with Java Standard Edition TCK testing. Changing the contents of tested build after the fact is often believed to be an invalidation of TCK coverage, and we cannot ship without that copyright/patent/trademark umbrella. Secondly, Azul offers cut down JREs and Compact Profile binary builds as a commercial (non-free) offering. We still need some way to monetize Zulu (else the business is not self sustaining) so charging fees and offering only private access to the set of lean & mean production runtimes is core to our business model.
I was wondering, why do we (Java community) need Apache Harmony project, while there is already an OpenJDK project. Isn't both are released under open source license?
It is the other way around. Harmony was formed BECAUSE Sun didn't want to provide an open sourced version and got big code donations from IBM and others (HP if I recall correctly) while building on GNU Classpath.
Around the time Harmony got "good enough" Sun decided to put their implementation under the GPL under the name of OpenJDK.
These days, Harmony provides an important alternative to OpenJDK as they are under the Apache license instead of the GPL. They haven't, however, passed the TCK-test to certify that they are compatible so it is not an official Java implementation.
EDIT: I believe also that Google built much of the Android stack on Harmony to avoid using code copyrighted by Sun (now Oracle).
EDIT: And since then IBM (according to rumors) got a perpetual Java license, and gave up on the Harmony project, which then almost instantly died.
2021 EDIT: Oracle has now chosen to change to a model where OpenJDK is the official development version, and Oracle Java is just one of now many distributions (where support can be licensed) one of which is https://adoptopenjdk.net/ which provides binaries both with the Oracle HotSpot JVM as well as the IBM j9 JVM.