How to open or execute an external program

edited August 2015 in How To...

I want to open an external program with proccesing (.EXE). It just needs to be started. On older posts people were talking about using an open function, but Processing says that it doesn't exist (the links to the refernce library are also not working).

Answers

  • Answer ✓

    import java.util.*; import java.io.*;

    Runtime rt;

    int exitVal;

    void setup() {

    rt = Runtime.getRuntime();

    try {

    Process proc = rt.exec("notepad.exe");
    
    proc.waitFor();
    
    //exitVal = proc.exitValue();
    

    }

    catch(Exception e) {

    e.printStackTrace();
    

    }

    }

    void draw() { }

  • Apparently, open() has been replaced with launch().

Sign In or Register to comment.