Implemented Runtime.exec(String) and Runtime.exec(String[]) and added test class

This commit is contained in:
James Sanders 2007-11-28 17:51:00 -07:00
parent 856935acc2
commit 3f0e8a9777

13
test/RuntimeExec.java Normal file
View File

@ -0,0 +1,13 @@
import java.lang.Runtime;
public class RuntimeExec {
public static void main(String[] args) throws java.io.IOException {
System.out.println("Executing internet explorer");
Runtime.getRuntime().exec("\"c:\\program files\\internet explorer\\iexplore.exe\" http://www.google.com");
System.out.println("Executing firefox");
String[] firefox = new String[2];
firefox[0] = "c:\\program files\\mozilla firefox\\firefox.exe";
firefox[1] = "http://www.google.com";
Runtime.getRuntime().exec(firefox);
}
}