how to run system command in java

how to run system command in java
/**
 * @author lautturi.com 
 * Java example: execute system command in java
 */

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");
	}
}
Sourc‮ww:e‬w.lautturi.com
Created Time:2017-09-29 14:05:49  Author:lautturi