[ 
https://issues.apache.org/jira/browse/PDFBOX-6214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr updated PDFBOX-6214:
------------------------------------
    Description: 
>From Wanling Fu in the users mailing list:

===

Stack excerpt, using PDFBox 3.0.7, JDK 25, GraalVM/Liberica NIK native image, 
macOS arm64:

java.lang.UnsatisfiedLinkError: Can't load library:
.../libawt_lwawt.dylib
at java.awt.image.ColorModel.loadLibraries(ColorModel.java:208)
at java.awt.image.ColorModel.<clinit>(ColorModel.java:215)
at java.awt.image.Raster.<clinit>(Raster.java:172)
at
org.apache.pdfbox.pdmodel.PDDocument.<clinit>(PDDocument.java:103)
at org.apache.pdfbox.Loader.loadPDF(Loader.java:...)
...

Note: this is not strictly macOS-specific. A similar failure also occurs on
Linux with GraalVM CE, where the AWT native libraries are not bundled. The
symptom is different there (NoClassDefFoundError:
java.awt.GraphicsEnvironment), but it comes from the same
PDDocument.<clinit> path. It works on Linux only when the toolchain bundles
AWT (e.g. Liberica NIK).

  was:
>From wanling in the mailing list:

===

Stack excerpt, using PDFBox 3.0.7, JDK 25, GraalVM/Liberica NIK native
image, macOS arm64:

java.lang.UnsatisfiedLinkError: Can't load library:
.../libawt_lwawt.dylib
at java.awt.image.ColorModel.loadLibraries(ColorModel.java:208)
at java.awt.image.ColorModel.<clinit>(ColorModel.java:215)
at java.awt.image.Raster.<clinit>(Raster.java:172)
at
org.apache.pdfbox.pdmodel.PDDocument.<clinit>(PDDocument.java:103)
at org.apache.pdfbox.Loader.loadPDF(Loader.java:...)
...

Note: this is not strictly macOS-specific. A similar failure also occurs on
Linux with GraalVM CE, where the AWT native libraries are not bundled. The
symptom is different there (NoClassDefFoundError:
java.awt.GraphicsEnvironment), but it comes from the same
PDDocument.<clinit> path. It works on Linux only when the toolchain bundles
AWT (e.g. Liberica NIK).



> PDDocument static AWT warm-up fails hard when AWT native libs are unavailable 
> (GraalVM native-image)
> ----------------------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-6214
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-6214
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.36, 3.0.7 PDFBox
>            Reporter: Tilman Hausherr
>            Assignee: Tilman Hausherr
>            Priority: Minor
>             Fix For: 2.0.37, 3.0.8 PDFBox
>
>
> From Wanling Fu in the users mailing list:
> ===
> Stack excerpt, using PDFBox 3.0.7, JDK 25, GraalVM/Liberica NIK native image, 
> macOS arm64:
> java.lang.UnsatisfiedLinkError: Can't load library:
> .../libawt_lwawt.dylib
> at java.awt.image.ColorModel.loadLibraries(ColorModel.java:208)
> at java.awt.image.ColorModel.<clinit>(ColorModel.java:215)
> at java.awt.image.Raster.<clinit>(Raster.java:172)
> at
> org.apache.pdfbox.pdmodel.PDDocument.<clinit>(PDDocument.java:103)
> at org.apache.pdfbox.Loader.loadPDF(Loader.java:...)
> ...
> Note: this is not strictly macOS-specific. A similar failure also occurs on
> Linux with GraalVM CE, where the AWT native libraries are not bundled. The
> symptom is different there (NoClassDefFoundError:
> java.awt.GraphicsEnvironment), but it comes from the same
> PDDocument.<clinit> path. It works on Linux only when the toolchain bundles
> AWT (e.g. Liberica NIK).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to