can't run the processing-java command from Raspberry Pi terminal (for a twitter bot)

edited July 2016 in Raspberry PI

Hi all, I've made a twitter bot using node and processing and it seems I cant get the processing program to run properly from the Raspberry Pi's terminal command.

When I run this command in the terminal: processing-java --sketch=pwd/bomb/ --run media.jpeg
I get an error of "Exception in thread "main" java.awt.AWTError: Can't connect to x11 window server using ':1' as the value of the DISPLAY variable. . .

I've tried running this command as well: processing-java --sketch=pwd/bomb/ --run media.jpeg -Djava.awt.headless=true
But I still get an error.

And this is after I've tried setting the display variable using this command I found from another post: export DISPLAY=":1"; /usr/local/lib/processing-3.1.1/processing-java

Does anyone have any advice for how to troubleshoot this some more? (I'm new to Raspberry Pi so apologies if the answer is obvious)

Answers

  • edited July 2016

    Hi,

    I've made a twitter bot also using processing and twitter4j library.

    To run processing you'll need to use Pi's graphical desktop environment (you can use raspi-config to enable the Boot to Desktop mode).

    Then, you can execute your sketch with this command:

    DISPLAY=:0 processing-java --sketch=/yourSketchFolder --present

    (Be sure processing-java folder is on your PATH)

    You can also check this web, more detailed explanation: https://learn.adafruit.com/processing-on-the-raspberry-pi-and-pitft/processing

Sign In or Register to comment.