Run processing sketch via comand line without windows system (ex: remote server)

edited January 2014 in How To...

Problem in the subject. Now Processing 2.0 throws java.awt.HeadlessException when I run sketch on remote server. I didn't run draw() method. Only setup() without size, image generated with PGraphics object. Have anybody solution for that problem?

Source Code Error Stack

Answers

  • Can you post the full stack trace here, as well as a small example that demonstrates the problem?

  • Kevin, sorry for accept, i don't no how to use this forum correctly))) And code formatter isn't the best here)))

    And I confused, not Nullpointer - HeadlessException.

  • Well, the problem is pretty self-explanatory: Processing is trying to do something that requires the display variable be set, and since you aren't working with a display, it throws an Exception.

    If you want to get to the bottom of exactly what it's doing, take a look through the Processing code, specifically line 10549 of PApplet.

  • Kevin, ok, i knew it. Maybe anybody hava a solution how to run this scketch without display? ))))

  • If I were you I would look through the Processing source to figure out exactly which line is throwing it, and then see if maybe there's a way to change a setting to avoid the error.

    However, this does raise a question: if you don't have a display, why are you using Processing in the first place? This sounds like a job for plain old Java to me...

  • Answer ✓

    This question is regularly asked...
    As KevinWorkman said, Processing isn't designed to be run headless. A sketch is an applet, which needs a display.

    I vaguely recall somebody making it work by connecting it to a virtual device, a Linux thingy...

  • KevinWorkman, I want to run my sketches on the cloud for generating images, I can do it without any display. I think generation on the cloud server will be more faster then do it on my laptop :) (I use this service, because they give 3 cloud "gears" for free)

    Thanks, guys! I'll try something else)

  • The virtual display Linux thingy is xvfb.

Sign In or Register to comment.