Java Runtime exec() method

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
import java.io.IOException;
public class Test {
public static void main(String[] args) {
try {
Runtime.getRuntime().exec("notepad");
} catch (IOException e) {
e.printStackTrace();
}
}
}
import java.io.IOException; public class Test { public static void main(String[] args) { try { Runtime.getRuntime().exec("notepad"); } catch (IOException e) { e.printStackTrace(); } } }
import java.io.IOException;

public class Test {
  public static void main(String[] args) {
	 try {
		Runtime.getRuntime().exec("notepad");
	} catch (IOException e) {
		e.printStackTrace();
	}
  }
}