This workaround enables pro­cess­ing appli­ca­tions to run on a head­less linux machine, e.g. a server. I needed the func­tion­al­ity for the auto­matic gen­er­a­tion of graph­ics on a debian­box with­out a graph­i­cal user inter­face and because pro­cess­ing requires a graph­ics envi­ro­ment this was the way to go.

  1. edit your sketch as usual in pro­cess­ing, until you are satisi­fied with the results
  2. export a appli­ca­tion from processing.
  3. copy the folder application.linux to your head­less box. there needs to be java installed on this machine. how to install java on debian? (ger­man)
  4. if you now exe­cute the script you get some­thing like: java.awt.HeadlessException: No X11 DISPLAY vari­able was set, but this pro­gram per­formed an oper­a­tion which requires it.
  5. to make java think there is a dis­play we must use a vir­tual frame­buffer. Xvfb is an X server that can run on machines with no dis­play hard­ware and no phys­i­cal input devices. It emu­lates a dumb frame­buffer using vir­tual memory.
  6. install Xvfb. on debian this would be:
    sudo aptitude install xvfb
  7. now you have to mod­i­fiy the script where java is called, it looks some­thing like this:
    #!/bin/sh
    APPDIR=$(dirname "$0")
    java -Djava.library.path="$APPDIR"
    -cp" $APPDIR/lib/Array.jar:$APPDIR/lib/core.jar" \
    Array
  8. insert this line:
    export DISPLAY=localhost:1.0
    to get this:
    #!/bin/sh
    export DISPLAY=localhost:1.0
    APPDIR=$(dirname "$0")
    java -Djava.library.path="$APPDIR"
    -cp" $APPDIR/lib/Array.jar:$APPDIR/lib/core.jar" \
    Array
  9. start Xvfb:
    Xvfb :1 -screen 0 1152x900x8 -fbdir /tmp &
  10. now you should be able to run your sketch.
  11. remem­ber to stop Xvfb when you’re finished

all this makes only sense, if you want to use pro­cess­ing to out­put data, e.g. pdfs, because you won’t (and actu­ally do not want) to see any­thing. if you need to import dynamic data from the data-folder in your pro­cess­ing file hier­ar­chy, you have to open the jar-file inside the lib folder and remove the data-folder. oth­er­wise the appli­ca­tion will only access the data-folder inside the jar.

these workaround is based on the arti­cle:
Grafikver­ar­beitung ohne grafis­che Oberfläche