Processing Notes

Skip to end of metadata
Go to start of metadata
  • This note assumes:
    1. You have installed Java 1.4 or greater.
    2. You have created a $JAVA_HOME environment variable.
    3. You have added the java /bin directory to your PATH.
    4. You have installed maven 2.
    5. You have created a $M2_REPO environment variable.
    6. You have added the maven /bin directory to your PATH.
  • If you can run mvn --version you are in good shape.

Create an empty Maven project

  • Create an empty Maven project to import a Processing project into:
    (please note it scrolls off to the right, make sure to highlight it all)
  • The project name in this example is ExampleSketch.
  • Copy the java classes into ExampleSketch\src\main\java.

Example pom.xml for a Processing project

  • Replace the contents of new pom.xml with this:
    (please note it scrolls off to the right, make sure to highlight it all)
  • This pom is dependent on version 1.0.3 of the Processing core.jar which (in this case) should be in your maven repo at: $M2_REPO\org\processing\core\1.0.3\core-1.0.3.jar
  • Processing does not publish jars to maven repositories. It is a manual task to create this directory in your repo, move and rename the core.jar archive into this directory.

Import into Eclipse

  • Creating the maven 2 project makes it trivial to import the project into Eclipse (and other IDEs).
  1. From the project root run:
  1. In Eclipse select File > Import, choose Existing Projects into Workspace and click Next.
  2. Browse to the project root directory and click OK.
  3. The Projects box should have your project listed. (If not confirm that there is .classpath and .project file in your project root and that there isn't a project with the same name already in your workspace.)
  4. Click Finish.

Packaging code into Executable jar

  • Finally maven 2 makes it easy to create a distributable executable jar.
  • From the project root type:
  • In the target directory there should be a file called ExampleSketch-1.0-SNAPSHOT-jar-with-dependencies.jar.
  • To run the jar type:

Processing Windows without Java - expert

  • The download does not include java and is about half the size.
  • The expert download allows the use of Java libraries compiled against java 1.5 and 6.
  • The startup is a little tricky, here is my startup script:
  • The ^ is the Windows continuation character.
  • The java 6 lives in C:\dev\tools\java\jdk1.6.0_07 on my system.
  • Any additional jars in C:\dev\tools\processing-1.0.3-expert-Wrj4P5 should be added explicitly, like lib/some-lib.jar;
Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.