I have encountered it before, I have forgotten it today, and I will mark again:
Under Linux, if you throw an Exception in Thread "Main" java.lang.internalerror: can't connect to x11 window server usding ': 0.0' as the value of the display variable. Solution is to run time plus -Djava.aw .HEADLESS = TRUE