george george - 7 months ago 14
Java Question

How to run Processing applications from the terminal

I'm currently using Processing for a small project, however I'm not liking the text-editor that comes with it. I use vim to write all of my code. I've found where the .pde file are and I've been editing them from vim and then I'm reopening them and running them (it takes a lot to reload the script and running it). That's why I want a solution where I can compile everything from the terminal.

On close inspection I've found the processing-java file that supposedly compiles and runs a sketch. However whatever arguments I supply it, it keeps on spitting the help page.
This is an example on how I'm running them.

(PS: I made a script that runs processing-java and added it to /usr/bin)

processing-java --sketch=/home/george/sketchbook/testproject --output=/tmp/processing/test --force --run


Can anyone help me please run my sketchs from the terminal?

Answer

I managed to do it by creating a bash script called pjava and the code is as follow if anyone is having this question:

#!/bin/bash
rm -rf /tmp/processing
mkdir /tmp/processing
/home/euler/Desktop/processing-2.0b8/processing-java --output=/tmp/processing/ --force --sketch=$1 --run

And the way I run it is as follow:

If I am inside a folder called project, I run pjava ../project and project.pde will get compiled and run.

Comments