I run a same project from Open Hpi Course. And I faced this PApplet Cannot Be Resloved error

71 Views Asked by At
import processing.core.PApplet;

public class Main {

    public static void main(String[] args) {
        PApplet.main(new String[]{TheApp.class.getName()});
            }

}

And here is the error:

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
    PApplet cannot be resolved
1

There are 1 best solutions below

3
On

You need to add Processing's core.jar library to your java projects build path / class path.

You should be able to find core.jar where Processing is installed/unzipped, inside the core/library folder.

Your IDE should have an option to add paths to .jar files (otherwise you can use the -cp flag in command line)

(The above should hold true for the default JAVA2D renderer and without other libraries. For P2D/P3D you'll need gluegen/jogl libraries, for serial you'll need serial.jar as well jssc java and native (JNI) libs, etc.)