Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling OpenJDK 7 without X11

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?

like image 784
javanix Avatar asked Apr 30 '13 21:04

javanix


1 Answers

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

like image 146
Elliott Frisch Avatar answered Sep 30 '22 09:09

Elliott Frisch