I am trying to run the process in the seperate environonment using the
runtime class as follows
Runtime rt;
Process p,p1;
rt=Runtime.getRuntime();
p=rt.exec("javac samp.java");
p1=rt.exec("java
samp);
the samp program is to get two arguments using the InputStreamReader
and add it.
I need to pass the two arguments from current program to
sample.java.so plz help me.
Manish Pandit - 21 Sep 2007 22:22 GMT
> I am trying to run the process in the seperate environonment using the
> runtime class as follows
[quoted text clipped - 9 lines]
> I need to pass the two arguments from current program to
> sample.java.so plz help me.
Not that what you're trying to do is unachievable, but is there a
reason that you have to compile samp.java from within this code? If
you can have samp.java precompiled, you can just do:
new samp().main(new String[]{argument0,argument1});
-cheers,
Manish
Roedy Green - 21 Sep 2007 23:47 GMT
>I need to pass the two arguments from current program to
>sample.java.so plz help me.
see http://mindprod.com/jgloss/exec.html
Note there are many variants overloads on exec to allow you to pass
parms an variety of ways.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com