Processing is built with Java and uses a few tricks to hide the complexities of the Java language. The Processing download includes a custom IDE (Integrated Development Environment) — the application that is called "Processing". It is gut-wrenchingly simple to get up and running and is a fantastic tool.
However, the Processing IDE suffocates when your projects become complex. It hinders fast development cycles because the compiler will give you obscure errors and there is no debugger.
The Eclipse IDE (which is a preferred IDE for Java development) is many times better and can be used with Processing. It's a little tricky to get going, but once you switch over to this IDE, your development time will be about 3 times as fast and much less frustrating.
Warning: this Instructuable is the least-exciting one I've written so far, and includes many steps. But if you use complex Processing projects — as I have for both work and for art projects — this could very well be one the most useful Instructables in your repository.
Step 1: Witness the Agony of Processing
From a developer's standpoint, the syntax-checking on Processing is primitive. When you're working with multiple functions and classes, a simple misplaced curly-brace can give you an single error message at the bottom like "unexpected token: void". I've often chased my tail in circles to sort out issues like this, even undoing my changes to revert to an earlier version of the code. It can be infuriating and counter-productive
Eclipse has much better syntax checking, including error-checking before you even run your program and a great file management system.
Plus it has a full-fledged debugger. No more println() needed!
Step 2: Install Eclipse
Choose your operating system (I'm using Mac OSX for the sake of the screenshots) and then download the Eclipse IDE for Java Developers from the Eclipse website.
The download takes a long time. Copy the package to your Applications directory. Run Eclipse and use the default settings for the location of your workspace.
Optionally, you can install some nice Color Themes for Eclipse here for eye-pleasing colored text on a black or gray background.
Step 3: Install Processing
Launch Processing, make sure it runs fine and then quit the application.
Step 4: What Is Proclipsing?
You can use the Processing drawing libraries in Eclipse without Proclipsing — by adding them manually — but the Proclipsing add-on makes it easier to create new projects as well as export finished applications.
Once again, the full guide to installing Proclipsing is here, however I will break down the installation into a few steps.
Here's an example of how Proclipsing can be incredibly useful. Pictured above is the animation engine for Tweets in Space. I wrote the software in Java, using Proclipsing to get it started. The application is a dual-projection animation that taps into an SQL database, which captures all live tweets with the hashtag #tweetsinspace. The tweets scroll up the side of the building, the lights in the building turn on and off, satellite dishes move back and forth and "beam" the tweets to spaceships which take them into deep space. This is exactly the kind of project that would be filled with frustration to do in the Processing IDE.
Step 5: Install Proclipsing, Step 1
In the "Work with" field, enter the name of the download (on Google code):
Click on "Add".
Step 6: Install Proclipsing, Step 2
The location field will contain the URL you just typed in.
For the Name field, enter Procilpsing
Step 7: Install Proclipsing, Step 3
Step 8: Install Proclipsing, Step 4
This will take you to the Review Licenses dialog. Accept the terms of the license and click on Finish.
Now, it will take a few minutes for Proclipsing to install on Eclipse. If you get a security warning, click on OK and continue. You'll be asked to restart Eclipse and you will now have Proclipsing available for use.
Step 9: Building a New Project With the Processing Libraries
Here is where you will be presented with the Processing Wizard — this is Proclipsing — which will let you select different Java libraries you want to include in your project. You could configure this manually, but it's a pain. Now, you can choose any of the "Processing Path" libraries (these are the ones included with Processing) or the "Processing Sketch Path" libraries (these are the ones you may have added).
Select Application (unless you want to run this as an Applet, but most people want a standalone executable).
This will create a new project in your Eclipse folder, import the libraries and create a Processing-based skeleton. Now, you're on your way.
Step 10: Examine the Skeleton Code
Notice how it includes the setup() and draw() function, just like in Processing. You can add keyPressed(), mousePressed() and all other functions that are normally available in Processing.
Our application class is now called AwesomeFun, which extends PApplet. This, in turn, extends Java's Applet class.
Step 11: PConstants
I've added some code into the setup() and draw() functions. Now, the textAlign() function calles PConstants.CENTER instead of just CENTER. Processing does a number of contortions to hide this from you, so now you have to find these in the the PConstants class.
Fortunately, Eclipse has some handy auto-fill features, so after you type in "PConstants." (don't forget the dot), it will give you a popup list with names of various constants you can select.
By the way, you never need to instantiate the PConstants class. It is a container for all the constant variables.
Step 12: PApplet in Other Classes
Bear with me, we're knee-deep in the technical bits here.
First, add code for a Ball class — just to see how this all works. In the constructor for Ball, we pass in the instance of AwesomeFun, which in turn can access all of the PApplet functions.
Now, go to File->New->Class and create a new class called Ball.
The code I have here shows a pretty standard technique where we save a copy of the PApplet object in the constructor. We later use this for the drawing functions: p.fill, p.ellipse, etc. Because the drawing functions are methods (or member variables, depending on your parlance) of PApplet, they need a valid instance of the PApplet class.
Once you get used to doing this for all your class constructors, it won't seem so weird.
Step 13: Export As an Application
Press Finishand the executables for all three platforms will appear in your workspace directory (i.e. in directories called application.macosx, application.linux, application.windows).
Boom. You have an application now that draws Hello World and a red ball on the center of the screen.
Step 14: Additional Questions
If you get stuck, the Integration & Hardware forum on the Processing.org site seems to be the best place for Proclipsing questions.