Panama and jextract on Windows
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Wed Apr 28 15:33:30 UTC 2021
I see - it seems like the new jpackage is setting java.library.path and
the previous version didn't?
@Andy, and idea of what changed in this area?
Thanks
Maurizio
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