Invoking a .exe file from Java
pass the .exe file path as a command line argument
import java.io.*;
public class InvokeExe
{
public static void main(String[] args) throws IOException
{
if (args.length <= 0)
{
System.err.println("Need command to run");
System.exit(-1);
}
Runtime runtime = Runtime.getRuntime();
Process process = runtime.exec(args);
System.exit(0);
}
}
A peep into SAP
15 years ago
No comments:
Post a Comment