윈도우



윈도우에서 프로그램을 실행

try {
    String[] cmdarray = {"cmd", "/y", "/c", "run.exe"}
    Process p = Runtime.getRuntime().exec(cmdarray);
    p.waitFor();
    p.destroy();
} catch (Exception e) {
    e.printStackTrace();
}


윈도우에서 스크립트를 실행하려면 cygwin을 설치해서 bash 를 실행시킨다.


try {
	String[] cmdarray = {"cmd", "/y", "/c", "bash run.sh arg"}
	Process p = Runtime.getRuntime().exec(cmdarray);
	p.waitFor();
	p.destroy();
} catch (Exception e) {
	e.printStackTrace();
}






리눅스


// TODO

'NATIVE > java' 카테고리의 다른 글

자바 프로그램 시간 측정  (0) 2013.05.27
java JSON library 다운로드  (0) 2012.08.15
오픈소스 라이센스  (0) 2012.08.14

+ Recent posts