Processing sketches (PDEs) are translated from the processing syntax to pure Java and are compiled and packaged into executable JARs. Is it possible to by pass the packaging step and go straight from the Java code to your own compiled class? Yes it is!
NOTE: Apart from your source and compiled class file, you will need the Processing “core.jar” binary to compile the class as well as run it.
- Use Processing to create a sketch file (.pde) and use the “Export” capability to export it to your native enviornment
- Open the generated export folder and navigate to the “source” directory. Inside here you will find the Java source file
- Compile the Java source file via:
javac -cp "core.jar" SOURCE_FILE.java
- Run the compiled class via the following command:
java -cp "core.jar:." CLASS_FILE