I am trying to compile OpenJDK 7 on a headless RHEL server. I have no desire to install a bunch of miscellaneous X dependencies just to build it.
Is there any way to compile OpenJDK 7 without Swing/AWT support (and hence, without the need to link against /usr/lib{arch}/X11 at build-time?
I don't think so. AWT and Swing are fairly core Java components. Also, Headless Java mode is achieved through with an AWT option (java.awt.headless=true
). Further, from How to Integrate with the Desktop Class -
If an application runs in an environment without a keyboard, mouse, or monitor (a "headless" environment), the
getDesktop()
method throws ajava.awt.HeadlessException
.
So it isn't as simple as compiling without X11 in Java. I believe the actual rendering is still done with X11 libraries (even when operating in headless mode).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With