logoalt Hacker News

Java 26 is here

238 pointsby mfiguiereyesterday at 6:44 PM238 commentsview on HN

Comments

dzongayesterday at 8:10 PM

the people that work on Java & the JVM are very smart.

it has become a best of breed language - hell its better than Go for industry purposes.

the drawback with Java will always be the CULTURE - (maybe someone can insert a quote of how in physics progress is only made, when old physicist die - I don't wanna be morbid ) but with Java same that's when the culture will change.

All those people using typescript (could be using Java - but the culture doesn't want them and consider them heretics for not embracing religion of OOP and FactoryFactory)

show 22 replies
pregnenolonetoday at 9:13 AM

If we ignore the fact that value types likely won’t ship before we have flying cars, Java has evolved greatly. I really like how they’ve solved concurrency, but I dislike how they’ve handled modules but this a minor issue.

The main problem with Java has always been its build tools. They’ve consistently been bad and continue to be. Even today, creating a bundled application with a stripped down JDK with jlink and jpackage is incredibly painful. You’ll need extensive knowledge of the Java CLI, modules, build tool plugins, or tools like Mill which simplify using jlink and jpackage, but even then it remains complex and frequently fails. In reality it should be as simple as something like "java package". Even these days, I frequently see Java developers presenting their desktop apps on Reddit and if you look at how they deploy them, it's often a fat JAR because they struggle to use jlink and jpackage effectively. Ironically, even generateing a fat JAR can be challenging.

As someone who has spent over two decades developing desktop applications including witnessing the shift to horrendous Electron firsthand I can tell you that this was a primary reason Java basically vanished from being so prevalent on desktops. Inexperienced developers often struggled to deploy even simple Java applications, grappling with either runtime incompatibilities (Ironically, developers are somewhat reintroducing the same problem with WebView-based applications) or having to tell their users how to launch a Java app. While some claim desktop apps are dead – which is nonsense – the same applies to CLI applications. CLI apps remain prevalent, primarily written in native languages or Golang, sometimes even Node or one of its derivatives. Rarely Java for the reasons I just mentioned and don't get me started with Graal Native. If someone decides to write a simple trivial CLI app in Golang, they'll simply build it with a single command and be done with it. With Graal Native, you'll have to go through using the tracing agent, and if you're lucky you'll have a fat native executable after minutes of compile time. Forget Graal for a minute though. Java would already go a long way if bundling your application with a stripped down JDK (jlink) was as easy as typing in a single command without having to deal with complicated Maven or Gradle plugins.

ludovicianulyesterday at 9:01 PM

I program in Java for more than 15 years now. I can resonate with people hating the language from it's early days due to the experience with all the enterprisy features and over abstractions. Or confunding Java with the Spring ecosystem. But Java came a long way over the years. It's now what many would call a "modern" language. It's less verbose, has many of the features people find appealing in Scala and Kotlin and it can even compile to native binaries using GraalVM. This made building CLIs in Java feasible. Or lambdas.

show 2 replies
xeubieyesterday at 8:05 PM

I think astronomers could measure the age of the universe in nano-Valhallas. Every year, it feels 50% closer to completion...

In all seriousness I'm happy with what Mr. Goetz and the team have done. Sealed interfaces (java 17) + exhaustive switch statements (java 21) means we now have union types in java! And instead of jumping on the async/await bandwagon we now have a more general solution that doesn't lead to API duplication (virtual threads). But Valhalla has been a veeery long time coming.

show 1 reply
vyskocilmyesterday at 7:29 PM

JEP 504: Remove the Applet API

Glad to see this being removed. Java plugins especially on Linux were awful and required by tons of corporate stuff. Anyone remeber IcedTea Web? A functional and opensource Java plugin and Java Webstart implementation?

show 3 replies
haolezyesterday at 7:20 PM

I was pretty surprised when I learned recently that the Java alternative for green threads doesn't use colored functions. It put Java in a higher place in my perception.

show 5 replies
einrealistyesterday at 10:22 PM

I have been using Java since version 1.4. Both the language and its ecosystem have come a long way since then. I endured the height of the EJB phase. I adopted Spring when version 1.2 was released. I spent hours fighting with IDEs to run OSGi bundles. I hated building UIs with Swing/AWT, many of which are still in use today and are gradually being replaced by lovely JavaFX. When I look at code I wrote around 12 years ago, I'm amazed at how much I've matured too.

show 1 reply
freedombenyesterday at 7:36 PM

As someone who has been out of the Java world for many years, but recently forced back into it due to Android dev requirements, Post lawsuit, what is the relationship between Android (Google) and Java now? When can we expect 26 on Android? On that note, why is Android always so far behind? Is it because Kotlin is primary or is it deeper? Did the lawsuit play a role?

show 3 replies
Bnjorogeyesterday at 9:14 PM

Man I still have scars learning Java in college. Took the entire fun out of coding until I ended up learning C.

GTPyesterday at 9:59 PM

I haven't read a Java manual since the time of Java 8. Do you have any books or other resources you could recommend to catch up with all that has changed in these years?

show 3 replies
EdwardDiegotoday at 6:09 AM

Seeing as we're having a $LANG war, after 15 years in JVM land, I moved to a Python / Go shop, and fuck I miss Java.

Not so much the language (although modern Java is pretty slick), but the stuff surrounding it.

* No typosquatting issues because every package has a group id verified by real humans and DNS TXT records.

* JMX as a standardized mechanism of exposing ways to interact with running code / expose metrics. (Even if you have to deal with the stupid ass protocol where you have to connect using a DNS identity the JMX server recognizes)

* Logging libraries that give people running the code control over what gets logged and how, not the developers (looking at you Golang, wtf is with your logging approach where devs have to explicitly consider the fact that you might want to run logging at DEBUG and code it into your start up args?)

* The ability (via JMX) to set, at runtime, one particular logger in one class or file to a desired logging level without restarting the application.

* The performance of the JVM.

* The vast FOSS ecosystem.

* Not having to fight C build chains for that one dependency that's using CGo or a Python wrapper around a C lib that no wheel supports for your given tuple of Python version, OS, and architecture.

Honestly, as someone who is a self-taught developer who taught himself in Python, I thought I was coming home to my first love.

Turns out, I really hate the horrible things you can do in Python - looking at you Django, don't be so dynamic your brains fall out - and really dislike the experience of trying to run a Go service compared to a JVM service.

Java and its ecosystem is just good at getting shit done in a predictable manner at both the dev level and ops level.

olivia-banksyesterday at 8:58 PM

Really glad to see we're getting a native PEM API.

show 1 reply
microflashtoday at 5:20 AM

Modern Java is pretty succinct and expressive and I enjoy working with it. Like any long-lived project, Java has its quirks and baggage but you can let go of that baggage if you want. The ecosystem is evolving nicely with new features and it is quite pleasant to work with these days. I’m looking forward to migrate apps at work to 26.

OSaMaBiNLoGiNyesterday at 10:47 PM

All the changes look great. But I don't know how I feel about the syntax. A lot of things that very well could be first-class just aren't. Instead of a `lazy` keyword, we get `LazyConstant<T>`.

I'm sure there's reasons as to why. I just don't know them.

show 3 replies
oystersareyumyesterday at 9:10 PM

Do changes to Java itself impact e.g. Clojure? I think it uses many java primitives instead of emitting jvm byte code but I can be wrong.

show 4 replies
gib444yesterday at 11:12 PM

I wonder what percentage of java code in the world is still java 8, and always will be?

badgersnakeyesterday at 7:47 PM

Vector API (Eleventh Incubator) - maybe 11th time’s the charm.

show 1 reply
devnotes77today at 12:04 AM

[dead]

AgentMarketyesterday at 9:18 PM

[flagged]

dxxviyesterday at 8:52 PM

Does the Java team use AI? If not, they should use it to give us more features and better performance in a release.

show 1 reply
larrylawnmowertoday at 12:22 AM

Are people still using gigantic xml file abominations (like pom.xml) with java? No thanks. Web moved years ago, and now most LOB software appear to also have switched to languages that are not that heavy weight and riddled with software patterns. And then the sdk still require accepting an EULA. Gtfo.

elgllhlhmhtoday at 12:06 AM

Too little, too late. Followers.

rusakov-fieldyesterday at 8:47 PM

Ah , Java, a language I pray I never have to ever touch again.

jesse_dot_idyesterday at 8:58 PM

Cool. I feel as though I'll never be able to escape 8, or ignore Ellison's legacy, unfortunately.

show 1 reply
wiseowiseyesterday at 7:06 PM

Android as always in shambles. Shame that neither Google, nor ecosystem cares about Java because they’ve bought JetBrains kopium.

show 2 replies
nameconflictstoday at 1:10 AM

I think Java became popular because of Sun. My experience with Java-based apps is bad. Laggy, resource-heavy, IDE bound, and it causes premature hardware performance degradation.