Loading native libraries from the classpath
Jeffrey Yemin
jeff.yemin at mongodb.com
Mon Jan 15 16:51:45 UTC 2024
Hi,
It seems fairly common for modules published to Maven Central to embed
native libraries in the .jar file itself, in order to avoid the
complications of applications having to install the native libraries
themselves.
Some libraries (including one,
https://github.com/mongodb/libmongocrypt/tree/master/bindings/java/mongocrypt,
that I maintain for MongoDB) delegate the extraction of the appropriate
native library to JNA, while others that use JNI directly (like
https://github.com/xerial/snappy-java) implement the extraction via custom
code (see
https://github.com/xerial/snappy-java/blob/v1.1.10.5/src/main/java/org/xerial/snappy/SnappyLoader.java#L53-L56
).
As the community starts to move away from JNI and JNA to the new Foreign
Function API defined in JEP 454, are there any plans to support the
automatic loading of native libraries from the classpath in the Java
platform itself?
Thanks,
Jeff Yemin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20240115/44831fdc/attachment.htm>
More information about the panama-dev
mailing list