Java calling program
Answers
Answer:
// A sample Java program (Written for Windows OS)
// to demonstrate creation of external process
// using Runtime and Process
class CoolStuff
{
public static void main(String[] args)
{
try
{
// Command to create an external process
String command = "C:\Program Files (x86)"+
"\Google\Chrome\Application\chrome.exe";
// Running the above command
Runtime run = Runtime.getRuntime();
Process proc = run.exec(command);
}
catch (IOException e)
{
e.printStackTrace();
}
}
Another way to create an external process is using ProcessBuilder which has been discussed in below post.ProcessBuilder in Java to create a basic online Judge