Java中的Process.Start帮助

Ale*_*lex 5 c# java arguments process

是否可以在Java中执行以下C#代码?

Process.Start("c:/test.exe", "filearg1,filearg2,filearg3");
Run Code Online (Sandbox Code Playgroud)

Pab*_*ruz 7

是的,但您需要使用RuntimeProcess类.

你可以使用这样的东西:

Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("c:/test.exe filearg1,filearg2,filearg3");
Run Code Online (Sandbox Code Playgroud)