Connecting Tech Pros Worldwide Forums | Help | Site Map

How to end process using Java?

Newbie
 
Join Date: Oct 2009
Location: Pune
Posts: 1
#1: Oct 9 '09
I am able to fetch all the processes which are running in Windows task Manager. Now I want to end a particular process from those processes. Is it possible in Java, or do i need to write some native code??

myusernotyours's Avatar
Familiar Sight
 
Join Date: Nov 2007
Posts: 168
#2: Oct 9 '09

re: How to end process using Java?


How are you fetching the list in of processes in the first place? Through native code?
I assume you only want to do it on windows.
You can use
Expand|Select|Wrap|Line Numbers
  1. Runtime.getRuntime().exec("taskkill /IM myprocess.exe");
  2.  
Regards,

Alex.
Reply