github twitter email rss
Using Processing from Intellij Idea
2012 Jun 1
2 minutes read

Using Processing from Intellij Idea

  1. .
  2. -
  3. Start a new intellij project
  4. Name your project
  5. Nothing to do here, just click Next
  6. First time you create a new project in Intellij you have to select a JSDK
  7. Click „New“ and select JSDK
  8. Its a bit strange cause there is nothing to select, but just click choose
  9. Click Finish
  10. Now add processings core.jar to your project. File→Project Structure
  11. Create a new global library
  12. Click „Attach Classes“and choose the path to processing app. Note on mac you can navigate inside the .app file
  13. Now write your sketch. Create a new class in your src folder. Right Click on your source folder.
  14. Start writing and enjoy auto complete while typing
  15. Code suggest
  16. Run your sketch
  17. Create the data folder in the root of your project.Right click on the root folder →New →Directory
  18. Basic sketch skelletonimport processing.core.PApplet;public class Sketch1 extends PApplet { public void setup() {} public void draw(){}}
  19. Wanna have fullscreen mode?static public void main(String args[]) { PApplet.main(new String[] { «–present»,«yourPackageName.yourClassName» });}
  20. Some differences from processingcolor cl = color (255, 0, 0);becomesint cl = color (255, 0, 0);float f = 1.2;becomesfloat f = 1.2f;mouseMoved(){}, draw(){}, keyPressed(){} etc.becomespublic mouseMoved(){}, public draw(){},public keyPressed(){}
  21. Need another libraryDownload and unzip the libraryChoose File→Project StructureSame way as adding processings core.jar
  22. Using OPENGLAdd opengl.jar, jogl.jar and gluegen-rt.jar like the core.jarNote, On OSX the libraries are located them to a folder of your choice.
  23. Add-Djava.library.path=Path/toThe/opengl.jarFileto the VM Parameters
  24. Got java.lang.OutOfMemoryError: Java heap spaceAdd-Xmx1024mto the VM Parameters file:

import processing.core.*;

public class Sketch extends PApplet {
    Walker w;

    public void setup() {
        size(300, 300);
        w = new Walker();

    public void draw(){

    static public void main(String args[]) {
        PApplet.main(new String[] {"--bgcolor=#FFFFFF", "Sketch" });

    class Walker
        int x;
        int y;

        int stepDistance = 5;
        int size = 10;

            x = width/2;
            y = height/2;

        public void display(){
            rect(x, y, size, size);
            fill(random(255), random(255), random(255));

        public void step(){
            x += (int) random(-stepDistance, stepDistance);
            y += (int) random(-stepDistance, stepDistance);

Back to posts

comments powered by Disqus