This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes run programs from a java source file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "run programs from a java source file" Watch "run programs from a java source file" New topic
Author

run programs from a java source file

arturo gennaro
Greenhorn

Joined: Feb 03, 2003
Posts: 2
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

Joined: Mar 08, 2001
Posts: 73
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 ]

<B>Hari Gangadharan</B><BR>Unix is user friendly..<BR>but it chooses to whom it is friendly with!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: run programs from a java source file
 
Similar Threads
java.security.AccessControlException: access denied (java.net.SocketPermission ftp.powweb.com
Running exe files with java
Connection is failing at ObjectInputStream for Server
Please Help
Singleton ( a Deeper Understanding )