[code] public class Test{ public static void main(String args[])throws Exception { Runtime rt=Runtime.getRuntime(); Process p=rt.exec("java Test"); System.out.println("asdasdada"); System.out.println(p.waitFor());
} } [\code] here i am running the same file being inside the same file... but it is unable to run new program.. can any one tell me why it is unable to run a program in loop form
A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
It's hard to say what's going on since you don't mention what is going on (just that something doesn't work), but -as this article explains- you may need to use the full path of the "java" executable, and you probably need to handle the output that the child process generates.