>>>>> "Robbie" == Robbie Baldock <[EMAIL PROTECTED]> writes:

    Robbie> At the moment I'm calling this in my servlet's init():

    Robbie> Runtime.getRuntime().exec("DISPLAY=localhost:1.1");
    Robbie> Runtime.getRuntime().exec("export DISPLAY");

    Robbie> Which I suspect is the wrong way to do it as this should be
    Robbie> done before the servlet starts.  So the question is, how do
    Robbie> I set this environment variable just for the servlet?

What you need to do is set DISPLAY variable for JVM (servlets have no
idea what environment variables are). So, as somebody already pointed
out, Xvfb must be running _before_ starting up your servlet engine.
Then you should set DISPLAY variable and start servlet engine having
this var set. Something like this should do:

#!/bin/sh
Xvfb :1 & # maybe you don't need last &
DISPLAY=:1 you_servlet_engine_start_command

Bye
Greg

P.S. Your approach with using Runtime.exec is wrong.


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to