The Juce messaging stuff is used at many places in JUCE code. Even in modules that are not related to graphical user interface (all the audio stuff for example). The problem on linux is that the messaging uses the X server to transmit internal juce messages, all none of this stuff works when you run it without a X server. I believe this is quite easily fixable by rewriting the juce_linux_Messaging.cpp file, in order to replace the XSendEvent stuff for internal juce messages by a custom message queue. The "juce_dispatchNextMessageOnSystemQueue" would then poll events from that queue, and from the X queue (when "display" is not null). That way we would be able to use more Juce classes in command-line apps.
This is something that I may try to do in the future, but I wanted to share my thoughts about this first.