Java Application from another Java Application
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   bomsetty_Naveen
Posted On:   Wednesday, August 15, 2001 02:19 AM

Can i invoke a Java Application from another Java Application.I am not getting the output as expected. public class NetSend { public static void main(String [] s) { new NetSend(); } public NetSend() { try { String cmd = "java NewTest"; Process p = Runtime.getRuntime().exec(cmd); p.waitFor(); int i = p.exitValue(); } catch (Exception e) {System.out.println("Exception : "+e);} } } public class NewTest extends Frame{ public NewTest(){ System.out.println("In New Test application"); } public static void main(String[] P){ NewTest t =new NewTest(); } }    More>>

Can i invoke a Java Application from another Java Application.I am not getting the output as expected.

public class NetSend {
public static void main(String [] s) { new NetSend(); }
public NetSend() {
try {

String cmd = "java NewTest";
Process p = Runtime.getRuntime().exec(cmd);
p.waitFor();
int i = p.exitValue();
} catch (Exception e) {System.out.println("Exception : "+e);}
}
}


public class NewTest extends Frame{
public NewTest(){

System.out.println("In New Test application");
}
public static void main(String[] P){
NewTest t =new NewTest();
}
}

   <<Less

Re: Java Application from another Java Application

Posted By:   Dermot_Hennessy  
Posted On:   Wednesday, August 15, 2001 02:39 AM

Please use formatting tags to describe code!!

Looks like you are not capturing the output from the application. Have a look at When Runtime.exec() won't from JavaWorld.

Dermot

About | Sitemap | Contact