import java.io.*; import java.lang.Runtime; public class IDE { public static void main ( String args[]) { Runtime r = Runtime.getRuntime(); Process process; BufferedReader pInput; String[] command = new String[3]; command[0] = "cmd"; command[1] = "/c"; command[2] = "javac IfExample.java 2> err.out"; try { process = r.exec(command); try { process.waitFor(); } catch (InterruptedException interruptedE) { } } catch (IOException E) { System.out.println(E.toString()); } System.exit( 0 ); } }