Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

run programs from a java source file

 
arturo gennaro
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to start some java executables from a java source fle.To be specific, at first I want to load 10 exes that have a listening socket each,then 20,that connect to the previous sockets and wait for socket connections, too,...etc.It is obvious that in order to start the second group of exes,i must be certain that all exes of thaefirst group are loaded and listen to connections correctly.
The only method i have found in java to run external exes is Runtime.exec().However this method is very slow and takes a very long time to make them start,compared to executing them through windows.Adding sleep() between calls doesn't help,unfortunately.
Is there a way to use a system call from a system independent platform as java?It would help me a lot.
Or else, has anybody any idea on how to start a bunch of exes from a java source file very quickly?
Thanks a lot
 
Hari Gangadharan
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it is java classes then you may be able to execute it directly as ClassName.main(). You may have to do that in separate threads.
Is there any reason why you should be running these java programs using a different Java VM?
[ February 03, 2003: Message edited by: Hari Gangadharan ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic