Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Compiling (and running?) on a headless server. #10

Open
caluml opened this issue Sep 24, 2014 · 5 comments
Open

Compiling (and running?) on a headless server. #10

caluml opened this issue Sep 24, 2014 · 5 comments

Comments

@caluml
Copy link

caluml commented Sep 24, 2014

Hello,

I'm using this library, and it's working well.
However, we have a headless Jenkins server that we use for creating release artifacts (RPMs), and the compilations are failing with:
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it., compiling:(viz.clj:24:3)
(and a long stack trace).

The machine I'm developing on has an X server (no surprise!), but the build server, and the final server don't.
(I've added Graphviz to the RPM dependencies of the release, so some things might get pulled in from there when it's installed on the server)

Is there any way to build this on a headless server?
Will it run on a headless server? (I just want it to generate SVG in answer to a web request).

Calum

@caluml
Copy link
Author

caluml commented Sep 24, 2014

I've worked around it by removing the rhizome dependency, and copying viz and dot.clj into my project, and removing most of viz that deals with images.

This compiles and runs fine.

Hope this is OK.
Not sure if there is a cleaner solution - perhaps detecting X11 displays at runtime, but I'll leave that up to you to decide... :)

Calum

@ztellman
Copy link
Owner

Try adding -Djava.awt.headless=true to your JVM arguments, and let me know if that fixes it. It should, and I should add this to the readme.

@devn
Copy link

devn commented Oct 8, 2014

@ztellman Unfortunately, no dice. getMenuShortcutKeyMask => http://docs.oracle.com/javase/7/docs/api/java/awt/Toolkit.html

@devn
Copy link

devn commented Oct 8, 2014

I should clarify: Running with -Djava.awt.headless=true gets rid of the X11 display headless exception, but (.. Toolkit ... getMenuShortcutKeyMask) will blow up with a HeadlessException under 1.7.

@ztellman
Copy link
Owner

ztellman commented Oct 8, 2014

Ah, I forgot that had been added in via a patch. Should be easy enough to detect the headless system property and bypass that bit of code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants