How to load customized native library?

tison wander4096 at gmail.com
Wed Sep 27 07:26:46 UTC 2023


Thank you!

This works as expected :D

Best,
tison.


Glavo <zjx001202 at gmail.com> 于2023年9月27日周三 15:21写道:

> Do we have something like System.loadLibrary, or respect the effect of
>> System.load/System.loadLibrary?
>
>
> See SymbolLookup.loaderLookup()
>
> Glavo
>
> On Wed, Sep 27, 2023 at 2:50 PM tison <wander4096 at gmail.com> wrote:
>
>> I'm using OpenJDK 21.
>>
>> Previously, I used System.load or System.loadLibrary to load native
>> library said "opendal_java".
>>
>> Now, with Linker.nativeLinker().defaultLookup(), the `find' result is
>> empty even if I call System.load property first.
>>
>> I read the code and it seems the defaultLookup only always look
>> up syslookup lib only.
>>
>> Thus, the only way I found to properly load customized native library is:
>>
>> final SymbolLookup lookup =
>> SymbolLookup.libraryLookup(absolutePathToNativeLib), arena);
>>
>> Do we have something like System.loadLibrary, or respect the effect of
>> System.load/System.loadLibrary?
>>
>> Best,
>> tison.
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20230927/52575236/attachment-0001.htm>


More information about the panama-dev mailing list