I am using:
Linux Debian 6,
Java 1.6.29 and
Tomcat 6
I’ve seen many posts about it explaining that java.awt requires X11 libraries..etc., but they are not solving the problem.
I set -Djava.awt.headless=true in my box and I worked around the first problem of the headless environment, now I am getting:
java.awt.HeadlessException
java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
java.awt.Window.(Window.java:432)
java.awt.Frame.(Frame.java:403)
javax.swing.JFrame.(JFrame.java:202)
org.jfree.ui.ApplicationFrame.(ApplicationFrame.java:65)
...
I know by doing this I just told java that there is no monitor (and in fact running a standalone java program to check if the environment is headless it does return true). So is it anything to do with the Linux environment like setting the DISPLAY env variable?
I would appreciate your help,
Thanks.
Thanks for your reply.
Since you gave me that I’ve been trying to text it. Still doesn’t work in the sense that: is now not throwing that exception anymore, but creating a blank image for some reason.
So I went from this:
to the following (getting rid of
extends ApplicationFrame) and use the example you gave me:in the log it complains about
ImageIO.write(bufferedImage, "gif", new FileOutputStream(path+getFilename()));giving this error (while the file is there!):Any clue?