Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2007

Tip: Looking for answers? Try searching our database.

Runtime & Process class

Thread view: 
frank - 21 Sep 2007 17:58 GMT
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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.