944,141 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 4806
  • Java RSS
Jul 5th, 2005
0

stopping an application execution

Expand Post »
HI everybody! I am starting a visual basic application from java with the following routine:

Runtime rt = Runtime.getRuntime();
try {
Process p = rt.exec("Grabacion");

}
catch (Exception e)
{ e.printStackTrace();
}
I want to know if there is any method in java that can make this application "grabacion" stop running...like a stop or quit exec or something like that! Hope someone can help me very soon!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
luisator is offline Offline
21 posts
since Apr 2005
Jul 5th, 2005
0

Re: stopping an application execution

try the destroy() method.
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Jul 5th, 2005
0

Re: stopping an application execution

I tried the destroy method but that one forces the application to close. My application is developed in Visual Basic, and if I use the destroy method the aplication doesnt reach the unload metho so I dont get the expected results. I need something like closing the window or something like that, is it possible??? Help me please, is the last step of my graduation project!!!!!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
luisator is offline Offline
21 posts
since Apr 2005
Jul 5th, 2005
0

Re: stopping an application execution

I've looked up the class api and can only find one other possible method that will help: exitValue()

It returns the exit value for the subprocess, but I don't know what you could do with that.

Now, one other way to kill the process is to call the kill.exe file on your computer(if you have windows).

Runtime.getRuntime().exec("kill fileID"), where fileIDis the Process Id. You'll probably have trouble finding the process ID, so I don't know about that either.


Overall, I think this is a problem with your VB code not handling the exit right, or else you're just out of luck.
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Looking for a garduation project
Next Thread in Java Forum Timeline: Question about java.lang.UnsatisfiedLinkError in MMAPI





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC