Introducing findjava, a tool to simplify JRE selection for Java applications

Some time ago, I wrote an article about distributing Java command-line applications and how difficult it is to locate the proper java binary to run your application with. But let’s have a quick refresher on the problem before going further. The Problem When distributing a Java application via package managers, your application should rely on one of the Java Runtime Environments (a.k.a. JRE) provided by the package manager. Ensuring the correct JRE will be installed as a dependency of your application is the job of the package manager....

<span title='2023-07-08 15:16:00 +0200 CEST'>July 8, 2023</span>&nbsp;·&nbsp;5 min&nbsp;·&nbsp;Loïc Rouchon

Distributing a Java command-line application

As a professional Java developer, I am comfortable with writing code in Java. Also, when I decided to write a command-line application, I asked myself if Java would be a good option in 2021 or if I should look more into alternative stacks like Rust. So let’s take a closer look at the challenges one has to face to implement a command-line application in Java. Creating a command-line application jar To write an application that can be used from the command-line, a simple public static void main(String[] args) is all you need in Java....

<span title='2021-12-11 12:26:00 +0100 CET'>December 11, 2021</span>&nbsp;·&nbsp;13 min&nbsp;·&nbsp;Loïc Rouchon

Pattern matching for switch in Java (JDK 17)

Old problems, new ways of solving it? If all you have is a hammer, everything looks like a nail. This sentence summarizes pretty much how I felt about the idiomatic polymorphism approach in Java to most problems until recently. Polymorphism is just a tool and as for any tool, it excels at some tasks and performs poorly at others. So what are the tasks where polymorphism does a good job at?...

<span title='2021-06-28 21:25:00 +0200 CEST'>June 28, 2021</span>&nbsp;·&nbsp;12 min&nbsp;·&nbsp;Loïc Rouchon