Hello everyone, Processing newbie here.
I'm trying to make something in Eclipse right now (with Proclipsing), but I'd like to be able to run it from the command line. I've got a very simple class set up:
Code:import processing.core.PApplet;
public class MainClass extends PApplet{
public void setup() {
println("foo");
}
public void draw() {
}
public static void main(String[] args) {
PApplet.main(new String[] { MainClass.class.getName() });
}
}
So now I have a bin folder with a MainClass.class in it. In the command prompt, I cd to that bin folder and run
Code:java -cp . MainClass
which gets me
Code:Exception in thread "main" java.lang.NoClassDefFoundError: processing/core/PApplet
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Caused by: java.lang.ClassNotFoundException: processing.core.PApplet
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 12 more
Could not find the main class: MainClass. Program will exit.
I'm pretty stumped. I've been trying for a long time now to get this to work. For what it's worth, I ran "java -cp . MainClass" just fine when I took out the Processing import statement and such from the class, but I can't get it to work with Processing.
Sorry if this is in the wrong forum or I forgot something. I'm a little exhausted right now.