package Runtime;
public class exec {
public static void main(String args[]){
Runtime r=Runtime.getRuntime();
Process p=null;
String cmd[]={"leafpad","/Runtime.java"};
try {
p=r.exec(cmd);
} catch (Exception e) {
System.out.println("error executing "+ cmd[0]);
}
}
}
---------------------------------------
package Runtime;
public class exec {
public static void main(String args[]){
Runtime r=Runtime.getRuntime();
Process p=null;
String cmd[]={"/root/firefox/firefox","daum.net"};
try {
p=r.exec(cmd);
} catch (Exception e) {
System.out.println("error executing "+ cmd[0]);
}
}
}
'Java' 카테고리의 다른 글
Runtime : freeMemory() (0) | 2015.01.28 |
---|---|
Runtime : exec(String command) (0) | 2015.01.28 |
Runtime : addShutdownHook(Thread hook) (0) | 2015.01.28 |
Runtime : availableProcessors() (0) | 2015.01.28 |
URL : openStream() (0) | 2015.01.25 |