News for hackers. Stuff that matters.
Re:Reasons to upgrade from Java 8 by jnwatson on Thursday April 15, 2021 @10:59AM (#26821283)
I've recently been exposed to problem of upgrading Java, and I think a big reason why folks don't upgrade beyond Java 8 is because of the licensing mess.

JREs are no longer distributed by Oracle. For client-side stuff, there's a linking tool called "jlink" that creates a minimal JRE for your app (and now you're responsible for keeping it up to date). Oracle wants a license to use their distribution. All that is a lot to catch up on.

IMHO, the best approach is to avoid anything Oracle touches and stick to OpenJDK. For a lot of corporate environments, that's anathema though.

Re:Reasons to upgrade from Java 8 by pron on Thursday April 15, 2021 @11:59AM (#26822119)
I work at Oracle on OpenJDK (but I speak only for myself):

1. OpenJDK is the name of the one and only Java implementation by Oracle (other companies contribute, but Oracle does ~90% of the work); all OpenJDK distributions -- from Amazon's through Microsoft's to Azul's Zulu -- are licensed to you by Oracle (read the license); and if you report to Amazon about a big in Corretto (their OpenJDK distribution), most of the time they'll forward it to us at Oracle to fix, because we're the ones actually developing the thing. So if you want to avoid anything that touches Oracle, OpenJDK is what you should avoid as that is the name of Oracle's implementation (look at the logo! https://openjdk.java.net/). But the "licensing mess" is Oracle open sourcing the entire JDK for the first time in Java's history, and using the name Oracle JDK as the name for their support subscription; if you don't want support, download the JDK from Oracle from http://jdk.java.net/, which, unlike all JDKs prior to 11 is actually completely free. The only licensing difference is that whereas the JDK used to be part open and part proprietary, part free and part paid, it is now 100% open and free. Oracle sells you support, or you can buy it from other companies that also offer support.

However, if you're on 8, your licensing situation is more problematic. Like all JDKs past their end-of-public-updates, you now have to pay for support, or use a free OpenJDK 8u build which 1. only contains backported patches that don't cover the entire JDK and 2. predates the full open-sourcing, so isn't identical to the old Oracle JDK. So not only is the license for versions past 11 better than ever in Java's history, the licensing situation for 8 is not that good because 8 is well past its free support period. Licensing alone is a reason to update.

2. There is no JRE anymore because there are no Applets and no Web Start, and so the model of a centralised runtime is not needed and has been replaced by something much better: custom bundled runtimes easily created with jlink. You, as the application's creator now have full control over its Java runtime, and your users don't need to interact with a third party, or even know or care that your application uses Java.

Re:Reasons to upgrade from Java 8 by yjftsjthsd-h on Thursday April 15, 2021 @11:08AM (#26821386)
> IMHO, the best approach is to avoid anything Oracle touches and stick to OpenJDK. For a lot of corporate environments, that's anathema though.

I thought that was just the obvious path; why would companies not like it?

Re:Reasons to upgrade from Java 8 by offtop5 on Thursday April 15, 2021 @11:14AM (#26821455)
Open Jdk tends to create random and strange issues.

At that point you might as well pitch migrating the tech stack to .net

Re:Reasons to upgrade from Java 8 by pjmlp on Thursday April 15, 2021 @11:18AM (#26821506)
Except that since several releases Oracle Java is basically OpenJDK + Support.
Re:Reasons to upgrade from Java 8 by p_l on Thursday April 15, 2021 @11:36AM (#26821734)
And some of those issues show up when migrating to recent Oracle Java, too.
Re:Reasons to upgrade from Java 8 by pjmlp on Thursday April 15, 2021 @11:54AM (#26822031)
Depends what you mean by recent.

For me recent means JDK 14 or later.

Re:Reasons to upgrade from Java 8 by yjftsjthsd-h on Thursday April 15, 2021 @11:18AM (#26821498)
That would be somewhat odd; isn't Oracle building off the openjdk as well?

And I have trouble crediting the idea that moving to openjdk is anywhere near the effort to move to a completely different language+platform, even if there are differences.

Re:Reasons to upgrade from Java 8 by offtop5 on Thursday April 15, 2021 @11:20AM (#26821536)
To be fair I haven't seriously touched java in about 4 years. I do remember Android studio explicitly warning users to avoid Open Jdk

My second point was a joke, still I wouldn't be the one to rock the boat. If anything is even slightly off after switching to open JDK you'd need to justify it

Re:Reasons to upgrade from Java 8 by yjftsjthsd-h on Thursday April 15, 2021 @11:43AM (#26821857)
> I do remember Android studio explicitly warning users to avoid Open Jdk

Once upon a time maybe, but today:

> A copy of the latest OpenJDK comes bundled with Android Studio 2.2 and higher, and this is the JDK version we recommend you use for your Android projects.

- https://developer.android.com/studio/intro/studio-config#jdk

> If anything is even slightly off after switching to open JDK you'd need to justify it

"We don't have to license it from Oracle" should justify a lot.

Re:Reasons to upgrade from Java 8 by offtop5 on Thursday April 15, 2021 @11:49AM (#26821937)
I'll admit when I'm wrong. Thanks for the info
Re:Reasons to upgrade from Java 8 by gjsman-1000 on Thursday April 15, 2021 @11:04AM (#26821341)
In that case why don’t they move to Amazon Corretto or other enterprise OpenJDK distributions?
Re:Reasons to upgrade from Java 8 by pjmlp on Thursday April 15, 2021 @11:15AM (#26821471)
Sorry but that is the typical FUD regarding Java and Oracle.

OpenJDK and Oracle Java are as different as Red-Hat Fedora and Red-Hat Enterprise Linux.

If you don't want to pay for Red-Hat Enterprise Linux support, just go with Fedora, or any other Linux distribution.

It is exactly the same with Java distributions.

Re:Reasons to upgrade from Java 8 by 2iP1zbR on Thursday April 15, 2021 @11:25AM (#26821585)
A problem is taking a company's entire Java codebase that's been running on Oracle JRE's, compiled with Oracle JDK's, written to work around Oracle bugs, for a decade, then trying to throw that on OpenJDK JRE's, compiled with OpenJDK JDK's. If it's a huge codebase then performance and runtime errors alone are concerning enough to stay frozen on 8 for as long as possible, without even considering code migration.

> just go with Fedora

I'm not disagreeing with this at all, but I do want to point out this was CentOS a couple months ago!

Re:Reasons to upgrade from Java 8 by chrisseaton on Thursday April 15, 2021 @11:51AM (#26821976)
I'm sure you know exactly what you're talking about... but I can't really imagine what major incompatibilities you're seeing while doing these upgrades. Java is amazingly backwards-compatible in my experience. I don't think I've ever had to change anything during an upgrade, in my entire career, except sometimes a couple of minor things to do with Unsafe. I'd love to hear more and some concrete examples if you're able to.
Re:Reasons to upgrade from Java 8 by 2iP1zbR on Thursday April 15, 2021 @12:50PM (#26822968)
I have no experience in upgrading Java versions or the corresponding code changes required. I have witnessed runtime differences, related to performance and GC behavior, from Oracle 8 to OpenJDK 8 that were unexpected enough to warrant temporarily sticking with Oracle in exactly one case.
Re:Reasons to upgrade from Java 8 by pjmlp on Thursday April 15, 2021 @01:47PM (#26823791)
That is eons ago, in Java 8 there were indeed differences between Oracle JDK and OpenJDK, this in no longer true since Java 10, even less so in Java 16.

Now, Java like C or C++, enjoys multiple implementations, so even across OpenJDK, J9, Azul, PTC, Aicas,..., there will be differences.

Re:Reasons to upgrade from Java 8 by bzzzt on Thursday April 15, 2021 @11:40AM (#26821807)
And that's why you have tests...

Having migrated some respectably sized projects to OpenJDK in my experience it's more work to migrate a codebase to a new Java major version than from Oracle to OpenJDK.

Re:Reasons to upgrade from Java 8 by varikin on Thursday April 15, 2021 @11:40AM (#26821799)
Are you serious? I've seen several large legacy Java applications move to OpenJDK without a problem.
Re:Reasons to upgrade from Java 8 by cesarb on Thursday April 15, 2021 @11:27AM (#26821622)
> OpenJDK and Oracle Java are as different as Red-Hat Fedora and Red-Hat Enterprise Linux.

In a comment in another sub-thread you said "Except that since several releases Oracle Java is basically OpenJDK + Support." But that would be more like CentOS and RHEL, not Fedora and RHEL.

Re:Reasons to upgrade from Java 8 by pjmlp on Thursday April 15, 2021 @11:52AM (#26822009)
Whatever, the point being that since the last couple of releases OpenJDK and Oracle JDK differences are mostly about support, and license of using JFR in production.
Re:Reasons to upgrade from Java 8 by bobthepanda on Thursday April 15, 2021 @11:33AM (#26821694)
IIRC wasn’t there a huge change in how APIs were exposed from 8 to 9 as well?
Re:Reasons to upgrade from Java 8 by pjmlp on Friday April 16, 2021 @02:17AM (#26830212)
Yes modules, but all the libraries in the Java eco-system that matter have long supported it, remember we are at Java 16 now.
Re:Reasons to upgrade from Java 8 by bobthepanda on Friday April 16, 2021 @11:25AM (#26835006)
That’s all well and fine for third party libraries, but less so if you work at some company with some internal framework or whatever using the old system still.
Re:Reasons to upgrade from Java 8 by pjmlp on Saturday April 17, 2021 @04:08AM (#26842506)
There are also companies still using Red-Hat Enterprise 5 in production with Java 4 (1.4), but I tend to avoid dealing with them as much as possible.