Minor thoughts (Re: [External] : Re: JEP draft: Prepare to Restrict The Use of JNI

Ron Pressler ron.pressler at oracle.com
Wed Sep 6 17:57:33 UTC 2023



> On 6 Sep 2023, at 16:34, Peter Tribble <peter.tribble at gmail.com> wrote:
> 
> 
> There's no speculation involved. 30 years of being a systems administrator gives you lots of
> experience. The scenarios I mentioned are ones I've repeatedly encountered in the field. (And
> have stitched up java applications, to boot.)

Java changed its recommended distribution model five years ago. It wasn’t fully a free choice (some aspects were forced by changes to the software ecosystem at large), but it was definitely a conscious choice. People needed a different way to distribute Java applications, and we could not offer the best possible experience for both the old way and the new way, so things *changed*. Maybe in some cases and some aspects for the worse, but in most — for the better. 

So yes, for better or worse Java did primarily encourage such a model for some 25 years, and then things changed, and now applications that want the best experience we can offer to them and their users can use the new way. Using the old way is available, but it is a choice. Perhaps it’s an appropriate choice in some situations, but it does have its downsides — as it always had.

> 
> It's not just my application; there are lots of other applications out there that end up
> being run. Which means that what I can and cannot do is immaterial - it's what all the
> other people developing and distributing java applications choose to do. And mostly,
> they don't do much - using jlink is extremely rare in the real world.

I don’t know about *extremely* rare (https://github.com/search?q=%22RUN+jlink%22+language%3ADockerfile&type=code) but jlink is *the* solution to the (rather old) problem of “how do I control my runtime?” You can choose to use and you can choose not to use it — and there may be tradeoffs either way — but you can’t complain about a problem that we’ve already delivered a solution for. Now that jlink does exist, we can rely on the fact that it’s available to anyone who wants a nicer distribution model. Over time I’m certain there will be even more reasons to prefer the new model, and more downsides to the old one.

> 
> There appears to be a considerable disconnect between the idealized world you're
> envisioning, one in which the JEP makes absolute sense, and the harsh reality of
> what happens in the chaotic, indeed anarchic, wider world.

If you are letting someone else pick the runtime for you, you also need to live in the real world where (pretty much since forever) not every Java application could run on every runtime version, and so those who pick the runtime need to be informed about such incompatibilities, and need to be warned about upcoming incompatibilities, as Java has already done several times over the last five years in the very real world.

— Ron


More information about the jdk-dev mailing list