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 classpth

Thread view: 
puzzlecracker - 07 Jan 2006 06:15 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.....
Rhino - 07 Jan 2006 15:50 GMT
> if I want to run a java application from the same java application:
> meaning parent process spawns  a child process, but passes different
[quoted text clipped - 17 lines]
> ps.I was trying to do something with listerner but cannot get printing
> to work.....

I found this article -
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps_p.html - very
helpful when I was getting started with runtime.exec(). You need to be a
little patient - the author takes some time to build up to the best approach
for using runtime.exec() - but I think you will do fine if you stick with
him to the end.

Rhino
Ranganath Kini - 08 Jan 2006 09:22 GMT
Why do u wanna chain multiple processes when ure trying to invoke 1
Java app thru another Java app?

Cant u create a new instance of the other application's main class by
calling its construtor and passing varying parameters and execute it
directly?

Avoid using Runtime.exec() when ure can be more efficient with the
language itself.

Hope this helps!

Regards,
Ranganath


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.