Panama and jextract on Windows
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Thu Apr 29 12:11:25 UTC 2021
For the records, I've just posted a writeup [1] on library loading, with
a proposal that will probably also help in this particular use case.
Maurizio
[1] -
https://mail.openjdk.java.net/pipermail/panama-dev/2021-April/013577.html
On 28/04/2021 15:58, Duncan Gittins wrote:
> There is a small change in behaviour when using jextract code with
> jpackage. I'm not sure if this is because of recent work to jpackage or
> foreign-panama - or whether this is concern for you right now.
>
> The jpackage within foreign-panama sets java.library.path for each
> generated EXE to:
>
> -Djava.library.path=C:\Program Files\APPNAME\app;C:\Program
> Files\APPNAME'
>
> Any Panama code that is run by generated EXEs fails to load certain Windows
> libraries:
>
> java.lang.IllegalArgumentException: Library not found: user32
> at
> jdk.incubator.foreign/jdk.internal.foreign.LibrariesHelper.lookup(Unknown
> Source)
> at
> jdk.incubator.foreign/jdk.internal.foreign.LibrariesHelper.loadLibrary(Unknown
> Source)
> at
> jdk.incubator.foreign/jdk.incubator.foreign.LibraryLookup.ofLibrary(Unknown
> Source)
>
> The jpackage from current JDK16 with exact same jars from JDK17 and
> --runtime-image made with jlink on JDK17 does not set java.library.path for
> each EXE and the panama code runs fine.
>
> Kind regards
>
> Duncan
More information about the panama-dev
mailing list