When not using the PDE, size() can only be used inside settings(). Remove the size() method from setup(), and add the following: public void settings() { size(300, 240); } Exception in thread "Animation Thread" java.lang.IllegalStateException: size() cannot be used here, see https://processing.org/reference/size_.html at processing.core.PApplet.insideSettings(PApplet.java:933) at processing.core.PApplet.size(PApplet.java:1969) at Hello.setup(Hello.java:5) at processing.core.PApplet.handleDraw(PApplet.java:2378) at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1527) at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:316)