Loading native libraries from the classpath
Ron Pressler
ron.pressler at oracle.com
Wed Jan 17 20:30:23 UTC 2024
A minor point, but perhaps worth pointing out as I’ve seen others raise the matter:
> On 17 Jan 2024, at 14:34, Mike Hearn <mike at plan99.net> wrote:
>
> (perhaps being moved onto the module path automatically, if found on the classpath)
For some entity X containing classes — today a JAR file or a classes directory, but perhaps it could also be a JMOD file — the flag `-p X` means "take the classes in X and place them in a named module, if resolved (whether or not X contains a module declaration)"; the flag `-cp X` means "take the classes in X and place them in an unnamed module (whether or not X contains a module declaration)". In other words, the classpath is what defines the content of the unnamed module.
There is no way for the classpath, which means “put these classes in an unnamed module” to do the opposite of its stated meaning. If someone wants a flag to mean “put X in a named module iff it contains a module declaration” it will need to be a new kind of path that’s distinct from the class path and the module path.
— Ron
More information about the panama-dev
mailing list