Live data from Hacker News

Which version of JDK should I use?

whichjdk.com

181–190 of 258 posts

Re: Which version of JDK should I use?

#181

Earlier quoted context omitted.

Currently upgrading a ~1M SLoC Java enterprise app (with regular Spring, Jetty in there, scheduled processes, PrimeFaces for web UI, REST API services, SOAP services, the whole shebang) from Java 8 to Java 11 (since 17 wasn't out when that change was approved) and it's largely proving to be a pain. Since the version of Spring is ancient and changes over to Spring Boot were also approved, now have to rewrite parts of…

Can you give a specific technical problem with updating from 8 to 11? Everyone says it's hard - nobody's ever able to give a practical example of a problem.

unsafe package no longer accessible/moved

Re: Which version of JDK should I use?

#182

Earlier quoted context omitted.

Currently upgrading a ~1M SLoC Java enterprise app (with regular Spring, Jetty in there, scheduled processes, PrimeFaces for web UI, REST API services, SOAP services, the whole shebang) from Java 8 to Java 11 (since 17 wasn't out when that change was approved) and it's largely proving to be a pain. Since the version of Spring is ancient and changes over to Spring Boot were also approved, now have to rewrite parts of…

Can you give a specific technical problem with updating from 8 to 11? Everyone says it's hard - nobody's ever able to give a practical example of a problem.

It is the dependencies. We bit the bullet and cut over (most) everything to Java 11 last year. Things that were removed from the JDK into new dependencies were the easier bits to sort - JAXB, some old Sun classes, and Java EE bits. All that was less than a week to sort. The real work were with the older 3rd party libraries not making the jump. You end up with turtles all the way down in some cases. Those took a serious amount of hunting for replacement. Mind you, the code was almost always something that had no budget or appetite for maintenance, so the moment you had to jump to a new package/API... folks often gave up.

All that said - for the 'normal' Springboot applications, we saw almost a 25% performance jump for the same code - updated libraries - running on K8. Java 11 was a substantial performance improvement. The jump for us to Java 17 will happen this winter, and looks to be a non-issue so far.

Re: Which version of JDK should I use?

#183

Earlier quoted context omitted.

Oh, I have a fun one. The company I work at leverages Nashorn for running some user-customizable scripts and when upgrading from 8 to 11 we found out that Nashorn changed the way they express numbers under the hood. Basically, every number is either an integer or a float and it used to be that every number was a long or a float. This silently broke a bunch of scripts and callbacks because of class cast exceptions and…

> involving some pretty scary reflection stuff for some unexplained reason This is where it always seems to end up. Why do people bend over so far backwards doing reflection that isn't specified?

Because Java, particularly pre-8 Java, sucks so bad if you try to actually write your whole application in it.

(I always found this really frustrating when making the argument for Scala. Yes, Scala-the-language is more complex than Java-the-language. But it's not more complex than the pile of reflection magic that anyone who tries to write a nontrivial system in Java actually ends up using).

Re: Which version of JDK should I use?

#184

Earlier quoted context omitted.

There's no real reason to use java for new development in 2021.

Java has a better technology stack. The JVM is light-years ahead of the .NET runtime.

Are you referring to its GCs, compilation tiers, or observability? ;)

Re: Which version of JDK should I use?

#187

These recommendations are pretty arbitrary and don't even attempt to scratch the surface of what is actually materially different between the JDKs. Don't use Corretto outside of Amazon... why? Don't use Dragonwell because... China bad? Use Red Hat OpenJDK if you're running on Red Hat servers, Microsoft OpenJDK if you're on Azure, SapMachine if you're on SAP, because... the name matches so that's nice? At least they'r…

[deleted]

Re: Which version of JDK should I use?

#188

I was literally just looking at JDK comparisons out of interest (I already have my app running under a JDK). But I'm still not convinced which is the "best" one. What are some difference between OpenJDK, Adoptium, Azul, BellSoft, etc. besides company dependencies and lifecycle? Which JDK is the fastest, or do certain JDKs perform faster under certain scenarios? Do any of these JDKs have any special features, or can t…

I think most JDKs these days are running mostly the same code (Oracle's Java) though a lot of them have little extra improvements or fixes (and some have longer support periods too). I try and stick with OpenJDK as that's the default Java implementation and it's probably a sensible default unless you have a requirement that one of the other ones specifically meets (like extended Java 8 security patches).

Re: Which version of JDK should I use?

#189

I’ve tried more than once to learn Java I find it very confusing. This website resolves one of the issues. The other issue I have is that most Java tutorials use IntelliJ, or some other IDE, which makes it difficult to figure out what a non IDE workflow actually looks like, some managing dependencies is confusing. I wonder if c# and mono is better in this respect

For non-IDE workflow use the Gradle dependency management tool and task runner - you can use javac on its own but for any non-trivial application the command line arguments will get very long.

Re: Which version of JDK should I use?

#190
post #50

So for those running Scala in production, which version do you use? I am still seeing a lot of projects on 8. New Scala projects are generally on Corretto 11.

https://docs.scala-lang.org/overviews/jdk-compatibility/over... talks about it a bit but I get the impression Scala is developed using the plain old OpenJDK so that seems like the safest option.
Post reply on HN