Java Runtime.getRuntime().exec

Java Runtime.getRuntime().exec

Executes the command in a separate process.

import java.io.IOException;
import java.util.*;

public class Lautturi {

	public static void main(String[] args) throws IOException {

		 Runtime.getRuntime().exec("D:\\Python\\Python37\\python.exe -V");// testing for windows
		 Runtime.getRuntime().exec("python -V");// testing for unix
		 Runtime.getRuntime().exec("ls -l");
	}
}
Source‮www:‬.lautturi.com
Created Time:2017-09-29 14:10:12  Author:lautturi