Posted By:
Christopher_Schultz
Posted On:
Friday, May 18, 2001 08:22 AM
If you use basically
anything associated with Java's AWT on UNIX, you must have an X server running. Most Linux users have an X server running, but that's not always enough.
The best thing to do is use something like xvfb which is the X-windows virtual frame buffer. That'll allow you to start a X server without a display (with no monitor). See, Java doesn't care about displaying anything. It just wants to use some services that X-windows provides. That's why you need the server.
Start up the server using a display number like "25" and then do:
$ export DISPLAY=localhost:25
...before you start the server. That will make GNUJSP use your new X server for all it's rendering needs.
If you don't want to do all that, an alternative is to use a 3rd party package that can read/write graphics without using AWT, OR get the specs for GIF and JPEG formats and read the file headers yourself to determine the height and width. This will probably be faster than using AWT, anyway, and having a faster Servlet is always nice {;-)
Good luck,
-chris