-
CSR
-
Resolution: Unresolved
-
P4
-
None
-
behavioral
-
minimal
-
Summary
Fix headless detection when AWT library not installed
Problem
Currently on jdk17u, a call to java.awt.GraphicsEnvironment#isHeadless
will return true only if the DISPLAY
environment variable is not defined. When this environment variable is defined but the JDK has been built in headless mode, this method will return false, leading some code to try to load the AWT libraries. However, a JDK built in headless mode does not have these libraries. This will then lead to throwing a java.lang.UnsatisfiedLinkError: Can't load library: /path/to/lib/libawt_xawt.so
which will generally not be handled.
That case if being met in some jpackage
test cases in OpenJDK, so trying to run the jpackage test suite on jdk17u will lead to the test failing due to this exception, even though the exact same tests work perfectly fine on JDK 19 and later
Solution
The solution has already been merged into JDK 19 with https://bugs.openjdk.org/browse/JDK-8286447.
Specification
The change consists in backporting the fix for https://bugs.openjdk.org/browse/JDK-8286447 to jdk17u-dev. It will extend the check for headless builds to the presence of libawt_xawt.so
on the library path, leading to stricter headless check. That would lead java.awt.GraphicsEnvironment#isHeadless
to return true in stricter but more correct cases.
- csr of
-
JDK-8324305 [Linux] AWT should start in Headless mode if headful AWT library not installed
-
- Open
-