12.4. Deploying in a Non-Windows Enviroment

EspressChart is a Pure Java tool for generating charts. As such, it does not contain graphical libraries for generating colors,fonts, and other AWT information. For that, Java relies on the system's (on which the charts are being generated) libraries for providing that information. Thus, an environment capable of providing AWT information and a graphics card (for exporting to static formats) are required.

In a Windows environment, nothing extra needs to be done to set up such an environment as it already exists. A GUI interface is already running and a graphics card already exists.

This is usually not the case for non-Windows environments (such as Unix and Linux). You need to have X or some form of X running on such systems and point the display to the machine running X (such as running the command export DISPLAY=192.168.0.16:0.0 in a shell). For the best performance, Quadbase recommends running X on the machine (or setting the DISPLAY to point to another machine running X). However, if that is not an acceptable solution, there are alternative solutions available.

12.4.1. Xvfb (X Virtual Frame Buffer)

Xvfb is an X server that can run on machines with no display hardware and no physical input devices. It emulates a dumb terminal framebuffer using virtual memory.

The primary use of this server is intended to be server testing. Xvfb is also limited in the number of colors and fonts it can handle.

Xvfb can be downloaded (there are different version available depending on the system) and then run. After Xvfb is running, the DISPLAY variable needs to be set, and then passed to the application (or the servlet engine).

12.4.2. JVM 1.4+ in Headless Mode

You can use a 1.5+ JVM run-time parameter to run applications using EspressChart. The run-time parameter is java.awt.headless and setting it to true results in Java not making an X connection for any graphics information. For example, if you have an application called chartExport that generates charts as jpg's, ordinarily running it would involve making a connection to X. However, using the following command:

java -Djava.awt.headless=true exportChart

the same application is now run without a connection to X.