Run a Papart App from Processing (Netbeans)


Run in pure Java

Processing is great for prototyping, however for larger projects you need structure. This structure can be achieved using pure Java. In this tutorial, we show how to:

  • Compile Processing applications in Java using maven.
  • Compile and Run PapARt applications in Java with maven.


Here you list the hardware / OS required: e.g.:

  • Hardware: any.
  • Operating system: Win/OSX/Linux.
  • Language: Java
  • Time required: 30mins.
  • Difficulty: easy.

Folder organization.

Processing: all libraries.

From the Processing wiki:How to Install a Contributed Library:

           Processing ## what sketchbook on linux
                 your sketch folders

PapARt library

The library stores the jar files that contains the code. In the library, we usually ship the source code, and the javadoc and more importantly all the calibration/configuration files.

           Processing ## what sketchbook on linux            
                                  calibration  ## cameras, projectors, tracking configs etc...
                                  markers      ## files for tracking and printing.
                                   PapARt.jar  ## (symlinks are supported)
                                   pca_transform.jar, jama.jar   ## other external jar files.
                             apidocs           ## javadoc

How PapARt finds its data.

When a PapARt application starts, it tries to find the `Processing` 
folder, then the `PapARt` library. This happens when lauched, from
Processing, or from maven. 

Seach process:

  1. The SKETCHBOOK environment variable. You can set it by adding in your ~/.profile file: export SKETCHBOOK=$HOME/sketchbook in linux. It works the same in Windows, or OSX.
  2. If there is no SKETCHBOOK environment variable, it tries to find the HOME variable, then on Windows and OSX the folder $HOME/Processing/libraries/PapARt/data/, and in Linux $HOME/sketchbook/libraries/PapARt/data/.
  3. (Worst case) If this also fails, it tries to find a file relative to the jar that contains Papart.class : ../data/.

In every case you will get feedback in the console :

Papart data path:  ....
## or an error: 
Error in loading the Sketchbook folder. 
Papart: Cannot find the data folder. It must be installed with the library.


PapARt is designed as a Processing libray and requires to be installed like so. This may become optional, or more configurable in the next release.


My Papart data path currently is correct, I can check with linux command echo $SKETCHBOOK.

But I have a concern here, like you said that:

Because we have dependencies from pom.xml when launched with maven. It will get library from PapARt library from Processing folder first or from dependencies first like following:


Currently, the version of PapARt library in Processing folder is 1.4.0 but in the pom.xml is 1.2-SNAPSHOT ( ) get from . Could you show me the way to get libraries directly from libraries in Processing folder in maven, because repositories seem out-updated for referenced libraries?

P/S: 2 java examples from doesn’t work with PapARt ver 1.4-rc.


Hello Hung,

The only java example is named “example” is the java folder. The other two: exampleDeploy, and exampleDeployNetbeans are created to run PapARt application on another machine.

You have to update to 1.4-SNAPSHOT, and compile PapARt before. You can access it on the forge: PapARt-1.4-rc.



Thanks Jeremy,

It’s working after I’ve modified the version of papart to 1.4- SNAPSHOT like you said and added some missing dependencies like following:


However, I got an other small issue. How we can configure this app for running on specific screen with the maven command mvn exec:java -Dexec.mainClass="tech.lity.rea.example.SeeThrough", it always runs on main screen. I need it runs on the screen of projection.

With processing IDE, we can select screen on File>Reference> Run Sketches on display. Do we have a similar when run with maven?


Yes, you can set the display to use from the fullscreen method:

void settings(){
  fullScreen(P3D, 2);  // 2 is display number.