Dear fellows,
I have a persistent problem with the Java mechanism to execute other programs
under RedHat Linux 9 and Java 1.4.2_08. (also under 1.4.2_05)
In C/C++ there is the System call, but in Java we have to use the "Runtime"
class. As suggested, I use the following code:
static int runOtherProgram(String[] args) throws Exception {
int exitCode = -1;
Runtime _runtime = Runtime.getRuntime();
try {
Process _child = _runtime.exec(callAndArgs);
_child.waitFor();
exitCode = _child.exitValue();
_child.destroy();
} // Ende try
catch(IOException e) {
System.err.println("IOException starting process!");
} // Ende catch
catch(InterruptedException e) {
System.err.println("Interrupted waiting for process!");
} // Ende catch
return exitCode;
} // Ende public static int runOtherProgram(String[] args) throws Exception {
This works fine for a long time BUT after about 2 hours and about
3000 calls, suddenly the exit code -1 is returned, whereas the called program
terminated without errors before.
Has anyone an idea what is going wrong there?
______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".