Kindly let me know, how to get the ProcessId of the Currently running Process in java. I want to get the processId and need to stop that particular process. I am trying this by using <code>proc.destroy();</code> method in my application. but the problem is not solved. The process is running yet. Can any one let me know how to forcily destory or stop the currently running process. If possible kindly give me the code for this....
Regards,
-
Stopping the Process Forcefully..... (2 messages)
- Posted by: Pardha Saradhi
- Posted on: September 24 2003 09:34 EDT
Threaded Messages (2)
- Stopping the Process Forcefully..... by Ian Mitchell on September 24 2003 11:36 EDT
- Stopping the Process Forcefully..... by Paul Strack on September 27 2003 15:35 EDT
-
Stopping the Process Forcefully.....[ Go to top ]
- Posted by: Ian Mitchell
- Posted on: September 24 2003 11:36 EDT
- in response to Pardha Saradhi
Process-based multitasking is not under the control of Java - the language is based on a threading model. Or perhaps by "process" you mean java.lang.Process? If so then the process has object identity, not an id.
But whatever your process is, it should have an exit code. Try checking that to see what it tells you. -
Stopping the Process Forcefully.....[ Go to top ]
- Posted by: Paul Strack
- Posted on: September 27 2003 15:35 EDT
- in response to Pardha Saradhi
Well, if you really want to kill the current process, System.exit() will work, but since there is only one process for your JVM, that will kill your entire Java enviroment.