How to execute a java program with the help of Runtime.getRuntime().exec(). For example we shall have the java file path as c:/java/abc.java. Please help me with the code.>
String path1 = "f://" + File.separator+username+File.separator+progName; Runtime runtime = Runtime.getRuntime(); String command = "javac -classpath " + path + " " + path1; System.out.println(command); Process process = runtime.exec(command); InputStream error = process.getErrorStream();