Question

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?

Was it helpful?

Solution

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 a java.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).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top