Process not giving prompt back with Runtime.exec!
- From: anon03@xxxxxxxxxxx
- Date: 6 May 2005 14:55:46 -0700
Hello All,
I was hoping someone could help me out with a problem I am having
after I execute a couple of batch files using the Runtime.exec method.
I have searched the boards for answer to this question but I couldn't
find anything.
I wrote an application in Java on the Win XP platform that basically
bounces a server. The first batch file stops it and the second batch
file starts it up again. After launching the application from within a
command prompt/MS-DOS window everthing works like it should. Through
the Task Manager I can see the server stopping and then starting again
and I can connect to it. That part is good.
When I exit out of the application after I perform this "bounce"
operation the UI closes but I don't get my prompt back. I have to hit
Control-C in the window to get it back or kill the server process that
I started. In the Task Manager, I can still see java process that was
from starting my application after exiting and its still alive. I know
what's happening. Since the server process was started from a Java
thread its going to hold onto that execution path/process/resources. I
want my prompt back after exiting the application.
Is there a way to get around this so the process is totally separated
from the JVM? Please tell me I don't have to write a C++ class that
kicks off a process and then access that class through JNI! Is there a
nice pure Java answer?
Thanks,
Joe
.
- Prev by Date: Re: NTEventLogAppender.setSource DOESN'T work!!
- Next by Date: Re: Making sure a class has a certain method
- Previous by thread: Getting Date Difference in Java.
- Next by thread: JSP page refreshed by refresh button show diffrent -changed values for same parameters?
- Index(es):