Is it possible to execute binary files in java?

Dimitri picture Dimitri · May 4, 2010 · Viewed 13.4k times · Source

I have a list of binaries written in Java, Ada, C, and Python and I want to execute them. How can I do that? Are there any JVM binding to those languages?

Answer

Oded picture Oded · May 4, 2010

If all you want to do is execute existing applictions, you can use the exec methods from the java.io.runtime namespace.

Runtime rt = Runtime.getRuntime();
Process ps = rt.exec("path to my executable.exe");