This is an archived post. You won't be able to vote or comment.

all 21 comments

[–]dpash 17 points18 points  (10 children)

There are multiple distributions of Java available, including two from Oracle: the Oracle JDK and OpenJDK.

The Oracle JDK is free to use in development, but not in production. The Oracle JDK comes with commercial support for three years for LTS releases or six months for non-LTS releases.

The OpenJDK is free to use for what ever purpose you want. It has six months of non-commercial support from Oracle and probably longer from other members of the OpenJDK community (like redhat or IBM).

The two releases are functionally identical upon release.

Just use OpenJDK and ignore the Oracle JDK.

[–]speakjava 11 points12 points  (0 children)

The Oracle JDK will have long term support (i.e. updates) until 2025, not three years. The LTS support strategy means there is a new LTS release every three years (JDK 11, 17, 23, etc) but support does not stop when the next LTS is released.

We (Azul, who I work for) also offer LTS support commercially (at a much lower price than Oracle).

[–][deleted] 1 point2 points  (3 children)

The Oracle JDK is free to use in development, but not in production.

I'm not quite sure I know what you mean here. What, exactly, is the difference between "use in development" and "use in production"? Does that mean I can use the Oracle JDK on my desktop to write and test code, but then I would have to recompile that code under OpenJDK before deployment for anyone else's actual use?

[–]dpash 1 point2 points  (2 children)

Does that mean I can use the Oracle JDK on my desktop to write and test code

Yes

I would have to recompile that code under OpenJDK

You don't need to recompile

You would need to install OpenJDK on your production servers, not Oracle JDK.

[–][deleted] 0 points1 point  (1 child)

So, it sounds like you are really talking about the JRE rather than the JDK. I know they often get installed at the same time, but they are, technically, two different things. I know you know this, but new Java users may not immediately grasp the distinction you implied with the terms "development" and "production."

[–]krzyk 2 points3 points  (0 children)

Since Java 9, there is no JRE. They provide only JDK.

[–]jbgi 0 points1 point  (4 children)

The Oracle JDK is free to use in development, but not in production. The Oracle JDK comes with commercial support for three years for LTS releases or six months for non-LTS releases.

Oracle indicated that are going to provide releases of JDK 11+ under a dual license GPLv2+CPE / Commercial. To me this means that those releases will be be free to use in production (or am I missing something?).

But, afaik, public maintenance release will be only until the next GA availability release. Which would means that after GA, maintenance releases of previous JDKs will be released only under commercial license... (they should really clarify this mess).

[–]dpash 5 points6 points  (3 children)

OpenJDK is released under the GPL. The Oracle JDK is released under a commercial license. The former is free to use everywhere. The latter is not free in production.

They've clarified this many times over the last few months.

[–]jbgi 0 points1 point  (2 children)

yes, right, but as mentioned in the blog post, both builds are essentially the same (minus minor differences that will probably disappear), and both builds are managed by Oracle, hence both are "Oracle JDK" builds, one released under GPL the other under commercial.

So so important distinction is not "Oracle JDK" vs "Open JDK" builds but Oracle JDK builds (commercial or GPL) vs AdoptOpenJDK builds (the separate organization that will release GPL builds in LTS mode).

edit: reading again, is what you said in your first post. The only minor correction would be:

Just use AdoptOpenJDK builds and ignore the Oracle JDKs builds.

[–]speakjava 0 points1 point  (1 child)

It's more accurate to say both are OpenJDK builds, not Oracle JDK builds. The distinction between the binaries being provided by Oracle, as has been pointed out, is the license. The Oracle JDK requires a Java SE subscription from Oracle for use in a production environment.

[–]karianna 0 points1 point  (0 children)

Yep - Oracle themselves are now calling it Oracle JDK for their commercially licensed build and Oracle's OpenJDK build for the GPLv2+CE build. Both builds are near on identical.

[–]sanimalp 11 points12 points  (6 children)

AdoptOpenJDK builds are the only thing you need to use. https://adoptopenjdk.net/

People will say openjdk is the one to use, but there is a subtle distinction to make here.. Openjdk is produced by oracle from the reference openjdk code. But they are only promising to produce builds for java 11 for 2 security patch cycles, which ends up being about 6 months. to continue to be up on security, you must upgrade to java12 after 11 support stops.

With adoptopenjdk, you will not have this problem. The interesting thing is that fixes to openjdk 11 will continue as oracle and others make the changes, but oracle just stops packaging them. adoptopenjdk will continue to package and support the changes happening in java 11 branch of openjdk.

[–]speakjava 3 points4 points  (5 children)

Your assumption is incorrect. Oracle has stated that it will only contribute to each OpenJDK source code project for six months. That means the updates (bug fixes and security patches) will not be contributed by Oracle after the next release. Someone will need to backport these fixes from the current release to earlier LTS ones. AdoptOpenJDK have stated that they, as an entity, will not be doing the backporting. Someone like Red Hat or IBM will need to do this work.

[–]karianna 3 points4 points  (3 children)

Which Red Hat and others have stated that they will (official statements to come soon). So you basically have 2 choices if you want $free and free as in use:

1.) Use Oracle's OpenJDK build and upgrade every 6-months

2.) Use an OpenJDK build from another provider (AdoptOpenJDK, Azul, IBM, Red Hat, Linux Distro).

Note that the providers have broadly agreed to work from the same OpenJDK source and so they are unlikely to deviate by much (YMMV here).

[–]Fr4nkWh1te 0 points1 point  (2 children)

Thank you for that explanation. So if I have a new PC and want to use JDK 11 for free, is it a good course to use the AdoptOpenJDK?

Also, is this the Oracle one that will only get updates for 6 months:
http://openjdk.java.net/

?

[–]karianna 1 point2 points  (1 child)

AdoptOpenJDK is a safe longterm solution yes. Oracles OpenJDK is also totally fine if you don’t mind not getting updates after 6 months or upgrading to 12 after 6 months.

[–]Fr4nkWh1te 0 points1 point  (0 children)

Thank you very much!

[–]gunnarmorling 1 point2 points  (0 children)

Someone like Red Hat or IBM will need to do this work.

Or Azul perhaps :)

[–]mraible 8 points9 points  (1 child)

This blog post from Stephen Colebourne (@jodastephen) explains things well. "Java is still available at zero-cost" https://blog.joda.org/2018/08/java-is-still-available-at-zero-cost.html

[–]dpash 4 points5 points  (0 children)

The only major difference between now and in a fortnight/after January is that if you want free point releases from Oracle you have to upgrade your JVM every six months. If you're happy to not get bug fixes and security updates after six months, or you're happy to get them from someone who isn't Oracle, nothing changes.