Processing 4 processing-java binary?

I’m looking for a way to use Processing 4 without relying on the PDE. Specifically, I’d like to know if a processing-java binary is distributed through any package manager (e.g., Homebrew, apt, pacman, etc.). I haven’t found any documentation in the repository about working with Processing in an editor‑agnostic manner, and I’d prefer to avoid using the built‑in PDE.

Any pointers or recommendations would be greatly appreciated—thanks!

Are you going to run your Processing files from the command-line? This is what I have for my mac:

Command line edition for Processing 4.4.10 (Java Mode)

--help               Show this help text. Congratulations.

--sketch=<name>      Specify the sketch folder (required)
--output=<name>      Specify the output folder (optional and
                     cannot be the same as the sketch folder.)

--force              The sketch will not build if the output
                     folder already exists, because the contents
                     will be replaced. This option erases the
                     folder first. Use with extreme caution!

--build              Preprocess and compile a sketch into .class files.
--run                Preprocess, compile, and run a sketch.
--present            Preprocess, compile, and run a sketch in presentation mode.

--export             Export an application.
--variant            Specify the platform and architecture (Export only).
--no-java            Do not embed Java.

Starting with 4.0, the --platform option has been removed
because of the variety of platforms and architectures now available.
Use the --variant option instead, for instance:

variant        platform
-------------  ---------------------------
macos-x86_64   macOS (Intel 64-bit)
macos-aarch64  macOS (Apple Silicon)
windows-amd64  Windows (Intel 64-bit)
linux-amd64    Linux (Intel 64-bit)
linux-arm      Linux (Raspberry Pi 32-bit)
linux-aarch64  Linux (Raspberry Pi 64-bit)

The --build, --run, --present, or --export must be the final parameter
passed to Processing. Arguments passed following one of those four will
be passed through to the sketch itself, and therefore available to the
sketch via the 'args' field. To pass options understood by PApplet.main(),
write a custom main() method so that the preprocessor does not add one.
https://github.com/processing/processing/wiki/Command-Line


Have you tried installing it from the Processing IDE menubar:

Hi @SNitaine! We’ve been hard at work trying to decouple Processing core from the editor and make everything a bit more modular. As of now that work is not yet ready though!

So far we have the following:

We have core published to maven central as a standard Java library.

We have the Visual Studio Code plugin

As for distributing processing-java as a standalone, if you look under the hood of that binary you will see that is just a wrapper around running the PDE binary with some extra arguments, so a decoupling is unlikely there.

2 Likes

Thanks for the info. I haven’t tried it, I am on a new machine and I haven’t downloaded the PDE yet… I am trying not to :smiley:

Oh I wasn’t aware that it is just a wrapper around running the PDE binary. I can only imagine how much hard work that goes into decoupling Processing. I will try and follow the process on GitHub.

Thanks, I will try and take a look at the maven core.

2 Likes

Not sure why you’re allergic to the editor, but alternatively you could get your hands on the executable and access that with the command line. Which operating system are you using?

I can’t recall where I got the executable, but I tested it and it works.

Hello @SNitaine,

Extracted from above link:

You can use processing.exe cli instead of processing-java.exe everything should be the same as before.

Editor-agnostic guidance that may work for a Windows 10 and Processing 4.4.10 environment:

  • Download the portable ZIP version:
    Releases · processing/processing4 · GitHub

  • You will have to (makes life easier) add processing.exe to your environment path.

  • This is the command-line for --help:
    D:\Users\GLV\Documents\P4>processing cli --help | more

Output

  • This will launch a sketch:
    D:\Users\GLV\Documents\P4>processing cli --sketch=alpha_gradients_1_0_0 --run
Output

Note the usage of cli in the above!

Folders structure will certainly be different on your PC.

You may accidentally launch the PDE if you make mistakes on the command-line!

If you are comfortable with command-line this is going to be fun!

You may also consider perusing the older versions of Processing for one that includes the processing-java.exe … for use with that version of course!

Have fun!

:)

I’m unclear about the availability of processing-java.exe. Is there a website where this may be downloaded? Is it platform specific, ie will a mac version run on Windows? Apparently Linux requires processing-cli ; if so, where can we get a copy? I’ve read on one of the github sites that processing-java won’t run on Linux.

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.
It is not intended to be a complete working example.

Have fun!

:)

procesing-java has been renamed to processing cli so we no longer need to distribute multiple binaries/scripts and works on all platforms. You can find more documentation here: Environment / Processing.org

3 Likes

What you have done appears to me to be similar to what is required to run Processing code in Eclipse: https://discourse.processing.org/t/why-p2d-not-working-inside-eclipse-when-i-using-the-processing-core/45930/8 , although in this thread far fewer jar files and libraries were required compared to what you describe. I’m curious about the size of the app which you created if it is exported as a standalone. As I recall the OP did not tell us what operating system he was using; therefore, we might need to try and reproduce what you achieved on other platforms.

I only compiled and ran the Java code.
I didn’t package it as a JAR file or create an executable.

It was presented as an option the OP may want to explore.

I was quite good at scripting in the day when it was all command-line!

Fond memories:

:)