I am working on a project on the comparatively slow Raspberry Pi system. I run the rpix86 DOS emulator in basic console mode (without X!) to maximize its speed.
I need to take screenshots (640x480) from it. My java implementation throws "AWTException: headless environment".
BufferedImage image = null;
try {
image = new Robot().createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
ImageIO.write(image, "png", new File("/screenshot + i" + ".png"));
} catch
Or, if I try
static { System.setProperty("java.awt.headless", "false"); }
then I get
java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable
Is it even possible to take screenshots with Java in the headless environment, or am I trying the impossible?
Thanks in advance! Theo