Loading native libraries from the classpath
Pedro Lamarão
pedro.lamarao at prodist.com.br
Wed Jan 17 12:52:30 UTC 2024
Em qua., 17 de jan. de 2024 às 09:20, Maurizio Cimadamore <
maurizio.cimadamore at oracle.com> escreveu:
> I think here is more of the same: we know there's an issue when trying
> to build and deploy Java applications with native dependencies. Panama
> does something to help in that direction: if you target a C library that
> is installed on your system (e.g. using apt) you might not need any
> heroics at all - because Panama can just load the system library using a
> library lookup [1] - a thin wrapper around dlopen which will find system
> libraries (by name) no matter where they are (same thing as dlopen can
> do). Of course, in some cases, a Java application might require a
> specific library with specific version - such cases can be addressed,
> for instance, by using a container (e.g. crate a docker image with the
> required installed dependencies, and run your Java app there).
>
Some of these limitations are in the system`s dynamic loader.
The loader cannot load a library from a "stream", only a "file path".
If it were improved to be able to do so, the requirement for temporary
storage would be lifted.
The appropriate library "stream" might be provided by a LibraryProvider
discovered with ServiceLoader where some property matches the current
architecture.
--
Pedro Lamarão
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20240117/c26bbeca/attachment.htm>
More information about the panama-dev
mailing list