Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8286598

[Linux] AWT should start in Headless mode if headful AWT library not installed

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 19
    • client-libs
    • None
    • behavioral
    • minimal
    • The worst that can happen is that apps run instead of failing with a cryptic error message.
    • Other
    • JDK

      Summary

      Automatically assume AWT headless mode if only headless AWT headless libraries are installed on Linux

      Problem

      AWT on Linux provides two native libraries, one for "headful" X11 desktop apps, and one for "headless" server apps. In some package install configurations, only the headless one may be available and installed, but if the DISPLAY variable is set, and 2D/Swing/AWT APIs are invoked, AWT will still assume it should use the "headful" library, leading to a RuntimeException and the AWT failing to start even if the application did not call any APIs that require a headful library.

      Solution

      Just as we have done for a long time if DISPLAY is not set, then similarly assume headless mode. Apps which only need headless mode will then run as expected, apps which required headful will get a more helpful error message.

      Specification

      There is no specification - this is a behavioural change as described above.

            prr Philip Race
            kcr Kevin Rushforth
            Alexey Semenyuk, Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: