Processing 4 processing-java binary?

Hello @SNitaine ,

This will set you free!

All you need is Java and the Processing core and libraries (included them all here):

And also the natives:

  1. To compile the sketch:
javac -Xlint:all -cp .\windows-amd64\lib\core-4.4.10.jar *.java
  1. To run the compiled sketch:
java -cp .\windows-amd64\lib\*;. -Djava.library.path=.\windows-amd64\lib\natives\windows-amd64 Sketch

Notes:

  • You should run these commands in a terminal window (command prompt) where the Java Development Kit (JDK) is installed and available in your PATH.
  • Make sure the core-4.4.10.jar and any other required libraries are in the specified windows-amd64\lib directory.

sketch.java (was generated by PDE and used as the template):

/* autogenerated by Processing revision 1310 on 2025-11-08 */

import processing.core.PApplet;

import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;

import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;

public class Sketch extends PApplet 
  {
  Helper helper;
  
  public void setup()
    {    
    helper = new Helper();
        
    helper.printMessage(); 
    println();
        
    println("***** Sketch Output *****");
    println();
      
    /* size commented out by preprocessor */    ;
    println("sketchPath:", sketchPath());
    }

  public void draw()
    {
    background(0, 255, 0);
    }

  public void settings() 
    {
    size(300, 125, P3D);
    }

  static public void main(String[] passedArgs) 
    {
    println("In the beginning...");
    println();
    printArray(passedArgs);
    println();
    
    String[] appletArgs = new String[] { "Sketch" };

    if (passedArgs != null) 
      {
      PApplet.main(concat(appletArgs, passedArgs));
      } 
    else 
      {
      PApplet.main(appletArgs);
      }
    }
  }

helper.java:

public class Helper {
  
  public Helper() {
    // Constructor (if needed)
    System.out.println("I am here to help!");
  }

  public void printMessage() {
    System.out.println("Helper class message!");
  }
}

This took me a while to achieve!
At first I extracted the natives from the JAR files as an exercise.

It was much easier to export a project from the PDE and all the core, native and even Java were ready to go to be used for any future self-contained project.

I did use the PDE later to export a project which generated all the necessary files (Processing core and libraries, natives and Java from Processing) but it was NOT necessary… just a lot easier. I did manage without doing this but it was a challenge and I did learn a lot from it!

The files in the folders can be reduced to a more minimal set.
I will leave that as as an exercise.

I also have the the java compile and run in a batch file:

The above was shared to demonstrate what can be achieved and a personal exploration only.
It is not intended to be a complete working example or represent best practices.

There are many ways to build these projects!

Have fun!

:)