Live data from Hacker News

Java 18 / JDK 18: General Availability

mail.openjdk.java.net

261–270 of 304 posts

Re: Java 18 / JDK 18: General Availability

#261
post #16
post #8

Earlier quoted context omitted.

I'll try: Java is a proven, boring and "easy" language without much surprise, with a big standard library and ecosystem.

Java is great, but here's a surprise: if (str1 == str2) { // oops }

Another surprise is it that it has issues on Turkish localized Windows operating systems.

Re: Java 18 / JDK 18: General Availability

#262
post #244
post #226

Earlier quoted context omitted.

It was just a coincidence. They do it right: ship when it is ready. LTS is not an openjdk term it is something that vendors might offer for any jdk version.

> LTS is not an openjdk term It's an Oracle term, and I expect the majority of OpenJDK committers and decision-makers are still from Oracle.

LTS was proposed by Mark Reinhold [1] who leads the JDK Project in the OpenJDK community in 2017. There was a lot of discussion [2] that resulted in many vendors supporting and adopting the LTS model.

It's a thriving ecosystem (which is great!) but yes, Oracle does contribute a significant portion [3].

[1] https://mreinhold.org/blog/forward-faster [2] https://mail.openjdk.java.net/pipermail/discuss/2017-Septemb... [3] https://inside.java/2022/03/22/the-arrival-of-java18/

Re: Java 18 / JDK 18: General Availability

#263
post #35

This is tangential and possibly too open ended to be productive but worth a shot anyway. Why is Java so popular? I know of a major Silicon Valley company that's migrating their backend to it. Why Java over other languages? Or maybe there's not really other viable options? I'm speaking as someone who spent the last 6 years focused on frontend web technology.

Java values backwards compatibility very highly, so if something runs today, it's likely to keep running without modification on future JVMs. (Though the 8->9 transition was pretty rough for some.) Compiled Java artifacts are usually portable across OSes and CPU architectures, so your build pipeline can be pretty simple even if your infrastructure is not. JVM performance is generally fine, and the language prevents y…

> Java values backwards compatibility very highly, so if something runs today, it's likely to keep running without modification on future JVMs.

this has been the case in the past, but Java is gritting its teeth and making some breaking changes in the JDK11/16/18 era.

libraries that mess with the unsafe/internal namespaces are the most prominent example - there are a ton of legacy libraries that are going to break from that change unless updated - but there's also a big push for modules and for classes to encapsulate themselves more strongly.

Re: Java 18 / JDK 18: General Availability

#264

Earlier quoted context omitted.

> Then why do I have to have multiple JVMs installed, which I need to go through via trial-and-error, if I'm given some random java application? You don't. Almost any Java program written ever will run on Java 18.

JavaFX isn't guaranteed to be in a JVM. You run into "deprecated" APIs that were removed. JVM options change, and that breaks how things are deployed. If the JVM were a stable target a site like http://whichjdk.com/ wouldn't be necessary. This is just how things are. It's Java fanfiction to say this isn't the case, and necessitates having multiple JVMs installed.

an odd one for me is JNLP - I have a motherboard with IPMI and they chose to do that through JNLP, which makes it an absolute pain in the ass to use the interface.

Re: Java 18 / JDK 18: General Availability

#265
post #190
post #74

Earlier quoted context omitted.

To echo others: relatively good performance, incredible tooling/deployment infra (really best-in-class), intercompatibility with tons of other languages built on top of the JVM such that it can be functional/do actors/whatever your other weird approach is, relatively high productivity due to a large library base (not just the standard library but also a huge amount of stuff written to support android apps), and ease…

> relatively good performance, That's kind of downplaying it right? Outside of "native" languages like C, C++, Rust, fortran, Java blows everything else out of the water.

(parent here)

Yeah, I'd agree (with the sibling as well). Obviously native code is faster but Java is about as fast as it gets for a managed language. It's massively fast (these days) in comparison to, say, Ruby. Python manages to do relatively OK by throwing away any sense of threading and the synchronization of internals that might entail but it's still significantly slower than Java.

Speaking of which that's another advantage of Java. Threading works basically as expected, and now it's even got modern promise/future APIs. Python's "just clone all your memory and do everything through IPC" is super clunky in comparison.

In many cases, that's also inherited by other JVM languages, and interop is really cool there too. You can use Java libraries in your Scala/Kotlin/etc, or call those routines from your Java code. It's not just one language, it's all the languages on one engine, and they all run decently fast for what they are.

C#/DotNet is really fast too (I would say faster than Java if anything) and it's pretty similar to Java in most ways. Bytecode, JITed, static typing, etc. They also got the second-mover advantage, to see all the things Java did wrong and fix them - like checked exceptions, or the clone() interface. On the other hand, at least as of 10 years or so ago, the tooling was absolutely primitive compared to what's out there for JVM stuff (and at the time it was all tied to Windows). Maybe that's changed with Roslyn but they're coming from behind, and Java has been around for a long time and it's tough to overcome that inertia.

Re: Java 18 / JDK 18: General Availability

#266
post #6

Is there a reason to use Oracle's closed-source Java implementation instead of the opensource implementations? Asking as someone who's ignorant about Java. edit: per comments below, Oracle's Java is open-source too these days.

Oracle's builds of Java are open source as well. The OpenJDK codebase is shared across all of the vendors that provide builds.

They might be built from the same source but they have draconian end user licenses and license changes that can unpredictably expose you to Oracle commercial licensing costs and lawyers chasing after you. See eg https://developer.ibm.com/blogs/java-licensing-is-changing-a... & https://www.theregister.com/2022/03/22/oracle_starts_to_incl...

Re: Java 18 / JDK 18: General Availability

#267
post #190

Earlier quoted context omitted.

> relatively good performance, That's kind of downplaying it right? Outside of "native" languages like C, C++, Rust, fortran, Java blows everything else out of the water.

Javascript in V8 is more performant than Java on a lot of tasks, and almost always 'sooner'. V8 is focused on 'getting going quickly' and it does, very fast. Java takes some time to optimize for most tasks. Also, 'performance' isn't really an issue once you are past 'good enough'. I don't think most devs are worried about Java/Node/Python/Golang performance on the backend for most apps. Obviously not always the case,…

> Javascript in V8 is more performant than Java on a lot of tasks,

Source? I constantly see companies switching from the likes of python and javascript to compiled languages after they reach a certain scale.

I find Java to be extremely developer friendly, especially nowadays with features like pattern matching, records, switch expressions, and the upcoming project Loom

Modern frameworks like quarkus.io are also a step in that direction. You might also want to check out https://jodd.org/.

Re: Java 18 / JDK 18: General Availability

#268
post #265
post #190

Earlier quoted context omitted.

> relatively good performance, That's kind of downplaying it right? Outside of "native" languages like C, C++, Rust, fortran, Java blows everything else out of the water.

(parent here) Yeah, I'd agree (with the sibling as well). Obviously native code is faster but Java is about as fast as it gets for a managed language. It's massively fast (these days) in comparison to, say, Ruby. Python manages to do relatively OK by throwing away any sense of threading and the synchronization of internals that might entail but it's still significantly slower than Java. Speaking of which that's anoth…

C#/.NET are cool. Ironically enough, Java is getting the second-mover advantage when it comes to green threads by means of Project Loom. Forgoing async/await for a much better experience.

Re: Java 18 / JDK 18: General Availability

#269
post #79
post #61

Meanwhile, still using Java 8 at work

I see this everywhere. What's the excuse in your case?

In my case: infrastructure group declines to support different Java versions for different use cases. We have a lot of Spark 2.x code, like thousands of different jobs. Spark 2.x only supports Java 8.

Re: Java 18 / JDK 18: General Availability

#270

Earlier quoted context omitted.

IMHO, Marketing. Java had so many marketing crazes that it's crazy. I still remember the "Java mobile game" fad from a dozen of years ago - Java this, Java that, Java for phone, Java for toaster... At some point, the public mind starts to associate "programming" with Java. Since there were (and probably always will be, unless we evolve into utopia) hordes of job-desperate people who would do anything to feed themselv…

I see this post is getting some downvotes; I'm not sure I agree with all of it myself. But I would ask those, who reject the premise here outright, to think back really hard to how things were in the 1990s. The Java brand was everywhere . It was a truly massive endeavour and one of the first languages to really go "viral" as the Solution For Everything. People laugh at the cute "Java runs on four billion devices!" ta…

I didn't name JS, Netscape management and marketing did the trademark deal with Sun to base its name on Java, which was truly hyped and heralded.

(Also, Scheme-Self, not Scheme-Smalltalk.)

Post reply on HN