ganeshkondal
Programmer
Hi ALL,<br> Is it possible to use this way ..<br><br> source files : a.java,b.java.<br>a.java - > compiled in the same dir (let it be c:\javaHome\a.class)<br><br> I want to use runtime exec to run a.class from b as if we do in cmd prompt.<br> --------------------------------<br>class a{<br> public static void main(String args[]){<br> System.out.println(" hai .. it works"
;<br> }<br>}<br>--------------<br>class b{<br> public static void main(String args[]){<br> //here the path to java & the a.class is //given seperated by a comma.<br> System.out.println("b4 calling exec"
;<br> ..= Runtime.getRuntime().exec("java ","a"
; <br> System.out.println("after calling exec"
;<br> }<br>}<br> -------------------------<br>if u run this class b .. it gives out <br>b4 calling exec and after calling exec ..<br><br>i expected "hai ..it works " to come out inbtw .<br><br>help me out.<br><br>regards,<br>ganesh