I'm trying to get a simple example to run. The below code compiles but gives me errors when I try to run it. I'm a newbie to Processing/Java. Also, my goal is to see if I can make a simple command line utility with processing for charting/graphics (very simple), kind of like gnuplot.
import processing.core.*;
public class MyProcessingSketch extends PApplet {
public void setup() {
size(200,200);
background(0);
}
public void draw() {
stroke(255);
if (mousePressed) {
line(mouseX,mouseY,pmouseX,pmouseY);
}
}
public static void main(String args[]) {
PApplet.main(new String[] { "--present", "MyProcessingSketch" });
}
}
I build with
javac -cp location/of/core/core.jar MyProcessingSketch.java
and run with
java -cp location/of/core/core.jar MyProcessingSketch
the error I get is,
Exception in thread "main" java.lang.NoClassDefFoundError: MyProcessingSketch
EDIT:
I've now tried
java -cp "location/of/core/core.jar:." MyProcessingSketch
and the error is now,
Exception in thread "main" java.lang.RuntimeException: java.lang.NullPointerException
--presentattribute? I don't see it mentioned in the JavaDocs.