How to use Processing to open a new ped file

I want to open a specified pde file when I press the mouse. I have tried the function runtime,getruntime().exec, but it can only open an exe file. How can I open the pde file?

Can you pass a simple code to understand what you need ?
But if you wan open a specific pde, I think the better way is compiled this one and pass by the method launch(String path);

I‘m new to Processing, I tried your way and it works! Really appreciate your help! BTW,on this basis, do you know how to pass the parameters while opening a new pde file?(I tried the way I used in JAVA and it didn’t work:( )

Sorry id’on’t understand what you want, can you pass your code ?

One way is to install the command line tools (processing-java) and then, from your launching sketch, pass it command line arguments.

You then interpret those command-line arguments in the new sketch. Previous related discussions: