How does Processing Export work?

Below is boilerplate code for using Processing source code in IntelliJ (available on web). To put the code back into Processing you would take size() from settings() and use setup() and draw() as is. This will work for a very simple app, but not sure how well it would work for a complicated project.

import processing.core.PApplet;

public class Main extends PApplet {
    // The argument passed to main must match the class name
    public static void main(String[] args) {
        PApplet.main("Main");
    }

    // method used only for setting the size of the window
    public void settings(){
        size(400, 400);
    }

    // identical use to setup in Processing IDE except for size()
    public void setup(){
        background(209);
        stroke(0);
        strokeWeight(5);
    }

    // identical use to draw in Processing IDE
    public void draw(){
        circle((float)width/2,(float)height/2,150);
    }
}

Getting an executable jar from IntelliJ is not easy according to this reference: https://lightrun.com/java/how-to-export-a-jar-from-intellij/ . I’m still trying to figure this out myself; wish I could be of more help.