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 / January 2006

Tip: Looking for answers? Try searching our database.

RunTime exec configuration for the child

Thread view: 
puzzlecracker - 07 Jan 2006 06:32 GMT
if I want to run a java application from the same java application:
meaning parent process spawns  a child process, but passes different
parameters (to avoid infinite spawning); does the child inherits
parent's classpath and other configurations
or  do I need to pass the classpath along?

If I am using linux env. and exported the classpath, will it be used.

Basically, I want the application to run on win32 (eclipse) and Linux.

Also, child process does a lot of printing, should create another
thread to monitor and read its output or what?

what is the general pattern for this kind of a thing.

Suggestions and examples will be appreciated.

Thanks

ps.I was trying to do something with listerner but cannot get printing
to work.....
Chris Smith - 08 Jan 2006 02:59 GMT
> if I want to run a java application from the same java application:
> meaning parent process spawns  a child process, but passes different
> parameters (to avoid infinite spawning); does the child inherits
> parent's classpath and other configurations
> or  do I need to pass the classpath along?

If you've specified the classpath via the "-classpath" command line
option, then you'll need to repeat that on the child process.  If you've
specified it with the CLASSPATH environment variable, that will be
inherited by the child process by default.

It's important to note that there's no special case in Process for
invoking another JVM.  You have to do it just like you would any other
process, and it follows the same rules.

> Also, child process does a lot of printing, should create another
> thread to monitor and read its output or what?

By printing, I assume you mean writing to the console (as opposed to
using a printer, for example).  Yes, you will need to read from the
resulting streams eventually, so the child process doesn't block
indefinitely.

Signature

www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation



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



©2008 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.