Alternatives to the Processing IDE
There are a number of code editors and IDEs for Processing (Integrated Development Environment) that offer more powerful tools, more comfortable interfaces and greater customisation of the workspace.
- sublimetext is a text editor for coders, with a simple interface yet many features to make coding more efficient. Plugins are available for editing and running Processing .pde sketch files. Sublime can be downloaded and used for free, but a licence must be purchased for long term use.
- Atom is a free text editor for coders, with many similar features to sublime. It even has google docs style real-time collaborative editing! Plugins are available for editing and running Processing sketches
- Eclipse is a full java IDE. You will be working in Java files instead of .pde sketch files, and you need to write your code in slightly more "pure" java.
- Intellij is a full Java IDE, with dozens of fantastic features but it's a step up in complexity. It has all the features you are looking for and many more that you will probably never need.
- Setting up IntelliJ:
When you work for processing in IntelliJ, you are coding in a java environment and just making use of the processing core library and build processs.
- Download the Processing Intellij template: https://github.com/mkj-is/processing-intellij
- Notice the file structure. Lib holds the
- Edit the ExampleApplet found in the src folder as you would normally edit a sketch file. Notice that some of the bare bones are revealed behind processing (we were actually just inside the processing library all this time!). The setup and draw functions are actually methods of the PApplet class.
import processing.core.*; public class ExampleApplet extends PApplet { public static void main(String args[]) { PApplet.main("ExampleApplet"); } @Override public void settings() { // TODO: Customize screen size and so on here size(200, 200); } @Override public void setup() { // TODO: Your custom drawing and setup on applet start belongs here clear(); } @Override public void draw() { // TODO: Do your drawing for each frame here clear(); fill(255); rect(50, 50, 100, 100); } }
4. To run the example, got to →Run→Run 'ExampleApplet' or 'ctrl R'
5. To export a clickable java application, you will need to set up artefacts. Go to →File→Project Structure and then click on the Artefacts tab. Click the + icon and add a new JAR 'From modules with dependencies...'. In the next dialogue box, select ExampleApplet.java as the main class file and click ok.
6. Apply and exit the Project Structure screen. To export the application, go to →Build→Build Artefact. You will then find the Jar file in the newly created 'out/artefacts' folder.