launch() won't launch my compiled processing sketch

edited February 2018 in How To...

One of my Processing scripts has launch("D:\Projects\application.windows64/mysketch.exe"). The .exe is a compiled Processing sketch.

I have tried calling both 32 and 64 bit version of the application, but it still won't work. Double-clicking the file opens it and runs it beautifully.

I have tried with other compiled sketches as well, but still nothing. No error messages are displayed, and I have verified that the path is correct.

Does anyone have any suggestions? I have also tried using \ instead of / in the path.



  • This took me a bit closer I think, but I can't seem to find any reference for exec(). When trying exec("file") I'm getting this error block:

    button1 - GButton >> GEvent.CLICKED @ 4895


    An error occured during execution of the eventhandler: CLASS: TrackerGUI METHOD: button1_click1 Caused by java.lang.RuntimeException: Could not open Tracker.exe processing.core.PApplet.exec( TrackerGUI.buttonClick( TrackerGUI.button1_click1( sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke( sun.reflect.DelegatingMethodAccessorImpl.invoke( java.lang.reflect.Method.invoke( g4p_controls.GAbstractControl.fireEvent(Unknown Source) g4p_controls.GButton.mouseEvent(Unknown Source) g4p_controls.GWindowImpl.mouseEvent(Unknown Source) sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke( java.lang.reflect.Method.invoke( processing.core.PApplet$RegisteredMethods.handle( processing.core.PApplet.handleMethods( processing.core.PApplet.handleMouseEvent( processing.core.PApplet.dequeueEvents( processing.core.PApplet.handleDraw( processing.awt.PSurfaceAWT$12.callDraw( processing.core.PSurfaceNone$

  • I can't seem to find any reference for exec()

    It is in the JavaDoc, not the public reference:

  • edited February 2018

    Flipping the slashes didn't do it for me, neither did using the full path. I'm already using the writer to make a .txt, so I don't think I can use it to make a .bat as well?

    I also tried running both Processing and the compiled sketch as admin, but it didn't help either.

    EDIT: For those seeing the link above, the .bat can obviously be made in advance, and be run using exec() or launch(). @kfrajer's answer contains the suggested code - cd to to the directory and use start sketch.exe

  • Ok, I did a demo here just recently:

    Just to add, it seems exec() is not able to launch an application. On the other hand, launch() did it but you have to call it from a batch file (.bat extension)


  • So I made a .bat file with start mySketch.exe, which successfully runs my application. But when I try to use exec("runSketch.bat") or launch("runSketch.bat") I get a windows-error: "Cannot find mySketch.exe...". This happened when I used the short path, as the .exe is located in the same folder as the .bat, and the .pde

    When using the full path in the .bat nothing happens, like it hasn't been executed, or that it closes immediately (nothing shown on screen).

  • edited February 2018

    Apparently, doing 'start "mySketch.exe" gives me a prompt in CMD. Maybe there is a path or parameter I need to pass?

    EDIT: The CMD opens in the folder I have Processing installed, and not from where the .bat is run. Help?

  • Answer ✓

    From the example I provided in my most recent link, I did this:


    This assumes the bat file is in your sketch folder. Within the bat file you should do this:

    cd d:\\folder\\containing\\exec\file

    Does this work for you?


  • Thank you so much, you beautiful being. I did just this with single \'s, and it worked.

  • Glad to hear!

    I did just this with single \'s

    Sorry, what do you mean?


  • e.g. d:\folder\containing\exec\file , no reason to use double slashes in a .bat I think

Sign In or Register to comment.