Language selector

Posts

Recently, somewhere on social media, I saw a code snippet. I guess the intention was to show how “Java is bad and dead”. I think it’s a good time to focus on some claims, falsehoods and half-truths that appeared in the comments, which I found pretty amusing. It also answers some of the criticisms raised in conference talks in autumn (checks the calendar) of 2026!

TL;DR: compact source files are already here, value objects from Valhalla are coming, you can keep your head in 2005, but be aware what year it is now.

Before I started working full time as a Developer Advocate, I had never come across the term BBL. Just reading the title of this post should already disprove the theory that it belongs exclusively to the medical world. It turns out that it does not.

So what exactly is a BBL and what is it not?

If I got a dollar every time I hear “we had to disable security and authentication in Elasticsearch because otherwise it was unusable”, I’d be a bit richer by now ;-)

Honestly, I don’t quite get where the confusion comes from. It’s 2024, yet some of us are still surprised by “what do you mean: certificate and password???”

Let me explain security in Elasticsearch in a few simple paragraphs.

Java 22 is about to be released tomorrow. There are many super nice things in this release. I suspect making Project Panama’s native/foreign calls will make many people’s life easier, as well as ongoing changes to concurrency, string templates and finally being able to call something before super. However, there’s one thing I guess is going to be my (almost) hidden hero of Java 22. Folks, I introduce to you Gatherers.mapConcurrent!

In the past I wrote two posts about Java sripts and their portability using shebang.

As far as I can tell everything in these two installments is still valid, only now, in Java 21, thanks to JEP-445 things can be even simpler. In this post I’ll try to describe fist the changes introduced by this JEP, then go deeper on how they relate to the “scripts in Java”.

I’m going to cover how you can simplify your main method, get rid of the class surrounding it, and even show you when it won’t work.

As I wrote in my previous post I had issues running code using JEP 443 using tools like Maven, Gradle or IntelliJ IDEA. Thanks to the one and only Tagir Valeev the solution is quite simple.

Upgrade to JDK 21.0.1.

And that’s it ;-)

No need to touch anything else. If you fancy more explanation, please follow on this Twitter thread.

And we shall all remember that upgrading is a good thing, because we’re not going to stay on Java 8 forever, right? ;-)

Update

The issue has been solved, please go to the post with solution.

Note: I’m leaving the original post below in case someone bumps to a similar issue in the future. Sometimes it’s easier to search using the problem ;-)

While preparing my Deep Dive talk on Java 21 for friendly Java User Groups, I’ve noticed a curious case of JEP 443: Unnamed Patterns and Variables (Preview). I’ve managed to create a reproducer, so I’d like to share the findings here.

Let me start this entry with a dad joke.

Simplified atom model

An electron rides a motorcycle. Suddenly, a police officer stops the electron and says:

‘I had to stop you, because you were speeding, driving exactly 178 and half kilometres per hour.’

‘Well, THANK YOU VERY MUCH, officer!’ the electron says, ‘Now I have absolutely no idea where I am!!!’

Some dad jokes are terrible, and don’t worry if you don’t get this one. It boils down to the uncertainty principle. In extremely oversimplified version: some things in the universe can’t be observed in all their aspects. If you have an apple, you can measure it’s mass, volume, size, (and if falls on your head) velocity, all at the same time. Without affecting the apple itself.
However, if you’re interested in electrons, the more accurately you know its speed, the less you know its location, and vice versa, hence atomic orbital. (Gosh, will atomic things stop chasing me? 😅)

I don’t always run public open trainings, but when I do, I try to run them as charity events. I believe this approach is meaningful and necessary. In this article, I will explain why I find it useful and important. However, let me begin by outlining some rules.

Feel free to adopt this idea if you find it appealing.

Rules

When running an IT charity workshop, I establish the following rules. It is crucial to adhere to all of them, as disregarding any could lead to complications.