1
votes
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
This error indicates that compiler can't see the required class PApplet. You must make sure that library containing this class is accessible (located on the classpath, or included into Maven's pom.xml or similar)Nikolai Shevchenko
@SaiAungHlyanHtet what IDE are you using (if any) ?George Profenza

1 Answers

1
votes

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.)