[External] : Re: Inconsistency with service loading by layer or by class loader

Ron Pressler ron.pressler at oracle.com
Sat Dec 14 00:20:36 UTC 2024



> On 13 Dec 2024, at 23:57, David Lloyd <david.lloyd at redhat.com> wrote:
> 
> if I design a library or framework to work *only* in module mode, the user might still try to use it in a non-module application container, possibly leading to (potentially subtle) breakage. If I design it only for classpath mode, then it may subtly break in module mode.

If you design a library or framework to work only on the module path, why would the user insist on putting it on the classpath? And if they do so accidentally, why would you not fail immediately with a clear message rather than risk some breakage?

> The problem is the run time behavioral differences.

That would indeed be a problem if you want *every* JAR to work both on the module path and on the classpath but, as far as I know, making that easy or even possible *for every JAR* is not and has never been the goal of the platform. I'm not saying it shouldn’t be the goal, nor am I trying to dismiss the difficulty of achieving that currently (which is expected given it’s not a goal of the platform as it currently is). I’m merely trying to understand *why* that’s needed.

— Ron


More information about the jigsaw-dev mailing list