Problems creating Graph2D objects on systems without X server

Troubleshooting

Summary

When running programs using Graph2D on systems without an X server, the programs crash with the following error message:
"X connection to ***.***.***.*** broken (explicit kill or server shutdown).".

This article was written for an older version. It is only online as a reference for customers using this old version. The information it contains is probably out of date.

The latest information can be found in the yFiles documentation

Description

This problem happens due to the fact that Graph2D normally communicates for several reasons (like getting font metrics) with the X server running on your system. If your program is executed on systems without an X server, e.g. on a server machine, this will lead to a program crash.

To avoid this problem, just tell your Java Virtual Machine to run without X server.
This is done as follows:

  • For JVM 1.4 or higher, simply start the JVM with the option -Djava.awt.headless=true.
  • For JVM 1.3.x you need to start a virtual frame buffer (aka "Xvfb") and point your DISPLAY variable to that device.

Categories this article belongs to:
yFiles for Java > yFiles Viewer
yFiles for Java > Deployment
Applies to:
yFiles for Java 2: 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9
Keywords:
Graph2D - program - crash - x server - connection - broken