Giving Up JRE considered harmful?

java October 7, 2021

On the Jigsaw mailing list, a user suggested that Java should have a separate JRE download, as opposed to the current situation of having only the full JDK (with compiler tools, etc.).

Java currently is gently pushing users into building native images with tools like jlink or perhaps GraalVM’s native image feature.

However, as the user points out, jlink can be an amazing burden compared to Java’s prior deployment of simple jars:

What happens if we use jlink? We need to care about every platform, even if the program works well on any platform. We need to prepare a separate distribution for each of them: Seven mainstream platforms (Windows x86, Windows x86-64, Windows AArch64, Linux x86-64, Linux AArch64, Mac OS x86-64, Mac OS AArch64), some non mainstream platforms but we have users (Linux ARM32, Linux MIPS64el, Linux LoongArch64, FreeBSD x86-64), and some platforms with potential users (Linux PPC64le, Linux s390x, AIX PPC64le, and more).

This is crazy. This will make our build process more cumbersome. We have to pay service providers from tens to thousands of times the cost of storage and bandwidth. What will we get? Worse cross platform, more bloated software, more cumbersome use steps and longer download time, but there is no better user experience.

As for my server deployment... Whether it is a traditional deployment scheme or a container scheme such as docker, I don't understand what benefits jlink can bring to me. I don't think I need to provide a reason for this, because only when I'm crazy will I use jlink to deploy my server.

Bombast aside, the point’s not entirely invalid. There is a balance point that considers developer burden and user burden, and tools like jlink may not consider the developer burden sufficiently yet.

On a Reddit post of the link, another user posted a fairly rational response that doesn’t address the pain points, but the rationale:

As a general rule, the answer to the question, "why did you do something that has downsides and disappoints me?" is almost always, "because we had to choose between that and another thing that has other downsides and disappoints others, and we picked the one that we believed to be better -- not perfect -- overall." The answer to the question, "but why did you change something that had worked well for me for a long time?" is usually, "because circumstances changed."

They’re not wrong - circumstances did change and the ability to build a native image can have very positive user responses, because installation is easier and smaller - but that still leaves the original poster’s points unaddressed.

in java kotlin jlink

Reading time: 2 minutes.