What causes the error "Can't connect to X11 window server"?
Access to an X display server means a few things:
- An X display server is running somewhere.
- The environment in which you run Java includes an environment variable DISPLAY identifying how to reach the server.
- There are no security settings in the server to prevent your client from opening a connection.
In general, if you're running your program from a terminal within the X Window System, all these things are true and the program just works. If you can run other X applications, like xterm or xclock, you should be able to run your Java AWT application.
New information for JDK1.4: JDK1.4 evidently includes a new property that will allow the AWT to run in a headless (without a display) environment. This setting is supposed to solve the problem: java.awt.headless=true