I do not think so. AWT and Swing are pretty core Java components. In addition, Java headless mode is achieved using the AWT option ( java.awt.headless=true ). In addition, from Integration with the desktop class -
If the application runs in an environment without a keyboard, mouse, or monitor (a "headless" environment), the getDesktop() method getDesktop() a java.awt.HeadlessException .
So it's not as easy as compiling without X11 in Java. I believe that actual rendering is still done with the X11 libraries (even when working in headless mode).
source share