Running a Processing 4 PApplet in Eclipse IDE

I have used Eclipse (since 2009) for developing several Processing libraries and I have found the following strategy works for me.

A minimum of two Eclipse projects
Project 1
This contains the source code , resources, ant scripts etc. to build the library.

Project 2.
This project contains all the tests, experiments and demo sketches used while developing the library.

In both projects the library path will be linked to any necessary Processing jars .

In project 2 we don’t link to our library jar rather we link to the actual library project. This makes debug mode and stepping through code so much more useful as it just slips into the library code.

My favourite way of coding main is

public class TestPixelAudio extends PApplet {

	public static void main(String[] args) {
		PApplet.main(new String[]{TestPixelAudio.class.getName()});
	}

This has two benefits

  1. the package name is included in the class name when using getName()
  2. Changing the class name through refactoring will automatically update the main() method
3 Likes