I'm aware that this is a recurrent question but I haven't found any answer yet.
I'm on a linux server (Ubuntu 14.04 LTS) and I have a java application that calls another one to do some operation, the first one runs with no problem, but the second one use GUI and when I call it I get the infamous error " No X11 DISPLAY variable was set, but this program performed an operation which requires it. ". I already have a Xvfb instance running and I exported DISPLAY.
Xvfb :99 &
export DISPLAY=:99
If I do
echo $DISPLAY
I get :99
I can run the called java application by command line and it works, but when it's another java application that calls it, it doesn't work. Why it doesn't "see" the DISPLAY variable when I call the jar from another java application ? And how do I fix this ?
NOTE : I use ProcessBuilder
to call it.