Java - looking for a tool to force-kill a child process (Windows)

Java - looking for a tool to force-kill a child process (Windows)

hello

I am looking for a Java tool/package/library that will allow me to force-kill a child process.

This tool/package/library must work on Windows platform (mandatory). Support for Linux/Unix is desired.

My Problem

My Java code creates a child process that will simply not react to the standard Java way for killing a child process: process.destroy(), and, since I do not have the child's source code, I cannot program it to better handle termination requests.

I have tried closing the child process' error input and output stream before calling destroy(), and for no effect.

I have even tried passing ctrlBreak signal (char=3) directly into child.getOutputStream(), and again have received the same results.

The workaround i have finally managed to find was to: 1. Obtain the child's PID upon its creation This can be done in Windows by diffinf the process lists before and after the child's creation (getRuntime().exec("tasklist /v")

  1. Use the child's PID to issue a force kill system command
    in Windows: getRuntime().exec("taskkill /pid " + childPid + " /f")

But - this is complex code i have no desire to debug and maintain, plus the problem itself, i have no doubt, was previously encountered by many other java developers, which leads me to the hope that such a Java tool/package/library already exists.

I just don't know its name...

Your help will be appreciated.

Gilad Haimov

PS: My child process was created by Runtime.getRuntime().exec(cmd), but i get the same behaviour using a ProcessBuilder.

View Answers









Related Tutorials/Questions & Answers:
child window - Development process
child window  I want to create new small window on my website using java script. But i couldn't hide the status bar in small window. How to do this one ? Kindly help me.   Hi Friend, Please visit the following
Parent child windows relationships when webpage is accesssed through a hyperlink.
Parent child windows relationships when webpage is accesssed through... is loaded. The webpage has parent/child windows. This timeout functionality works in the parent window(home page) even when the child windows are open. And so i
Advertisements
BIRT reporting tool - Development process
BIRT reporting tool  How to call BIRT reports from jsp or servlets. what is the tree architecture? And what is the process to deploy BIRT project in tomcat server. just give small application to call BIRT reports from jsp
Java process
Java process  How will you invoke any external process in Java
Process in Java
Process in Java  how can I execute a java program as a process which i can monitor it in the task manager to see the cpu usage
How to Differenciate Main Thread and Child Thread in Java
Main Thread and Java Child Thread. Please Suggest any example or online link... Language. These are Java Main Thread and the Child Thread. The Below reference...How to Differenciate Main Thread and Child Thread in Java  hi
java tool
java tool  I installed edit plus tool but it couldn't compile and excute the coding ...how to retify that problem
Running Java Applications as a Windows Service
Running Java Applications as a Windows Service  sample code for "Run a Java application as a Windows Service
Java for Windows
Java for Windows       First of all download jdk for windows and then install and configure the Java SE...  Setting Up the Environment for Java on Windows: This section describes
read/write to Windows Registry using Java
read/write to Windows Registry using Java  read/write to Windows Registry using Java
Java get windows Username
Java get windows Username       In this section, you will learn how to obtain the window's... of the windows. System.getProperty("user.name")- This method retrieve the username
java classpath prbm in windows 7
java classpath prbm in windows 7  i have a problem to set... that user variables i set them like this: CLASS .;C:\Program Files\Java\jdk1.6.0_32\lib; in system variables PATH .;C:\Program Files\Java\jdk1.6.0_32\bin; after
java code - Development process
java code  hi, this is sampath, how to acchive the batch processing in java or batch process base java thread. can u send the code and brief explanation. thanks and regards sampath reddy
how to access windows registry information using java?
how to access windows registry information using java?  can any one help me how to access windows registry information using java
process of compiling and running java program
process of compiling and running java program  Explain the process of compiling and running java program. Also Explain type casting
Thread and Process - Java Beginners
, VijayaBabu.M  Hi vijayaBabu A process can contain multiple threads. In most multithreading operating systems, a process gets its own memory address... process. For instance, a JVM runs in a single process in the host O/S. Threads
java tool - Java Beginners
java tool  HI,i'm doing a project to implement BASIS PATH TESTING..so,i want a java tool which takes the c-program as the input n converts it into a control flow graph...can anyone suggest? thanking you
java tool - Java Beginners
java tool  HI,i'm doing a project to implement BASIS PATH TESTING..so,i want a java tool which takes the c-program as the input n converts it into a control flow graph...can anyone suggest? thanking you
Reading child of child nodes in xml
Reading child of child nodes in xml  Hi I am using the following XML file and would like to read the data for respective date in the child nodes. I.... This is the first time I am calling child of child node. Please help. Thanks in advance
JAVA Debug tool
JAVA Debug tool  Hi , I invoke the JDebugTool using the following command on MS DOS : "c:/Users/mkarapanahalli/Programfiles/Java/jdk1.7.0/bin/java..." com.debugtools.jdebugtool.Main That works fine and starts the Debug tool. I mount a source path and try
Installing NLTK on Windows 10
Installing NLTK on Windows 10 with pip In this tutorial we are going to explains you the steps to install NLTK library on Windows 10 with the pip tool... download Python installer on for windows 10 and then install it on your
Installing NLTK on Windows 10
Installing NLTK on Windows 10 with pip In this tutorial we are going to explains you the steps to install NLTK library on Windows 10 with the pip tool... download Python installer on for windows 10 and then install it on your
Tool In JAVA - CVS
Tool In JAVA  Hai this is JAGADHISH Iam learning cvs tool.If anybody have related material or examples for this CVS tool plz send me.Thank you(in advance).  Hi friend, For read more information to visit this link
How to download and install Java 8 on Windows?
How to download and install Java 8 on Windows?  I am beginner in Java going to learn and make program in Java. Is there any tutorial for setting up Java development kit? Tell me How to download and install Java 8 on Windows
core java - Development process
. The process is known instantiation For example : class... to : http://www.roseindia.net/java/master-java/java-object-oriented-language.shtml
java - Development process
java  hi, can u send an example code in MVC Architecture for gym process i just want to get register id from database for citizen .then he will add is suggestion in text box and submit it i am sending jsp page u will get idea
JAVA - Development process
StreamResult("data.xml"); initXML(); process(test...(); handler.startElement("","","Roseindia",atts); } public static void process (String s
Video Tutorial: How to get windows username in Java
How to get windows username in Java Java is a set of computer software... tutorial of "How to get windows Username in Java?": ADS_TO_REPLACE_1 In this tutorial we will learn how to get windows user name in java in a few easy
Java - Development process
to integrate two java program. u can integrate java pro with other software or tool. To integrate 2 java programs use "is a relationship" and "has a relationship" ie... to integrate the two or more class in java language.please send the message
java - Development process
Java Sort String Array  How to sort string array in Java
Java Steps - Development process
Java Steps  what are the steps to be taken to create a mobile phone compatible java swing program
java server - Development process
java server  Develop multi-threaded echo server and a corresponding GUI client in java
java with linux - Development process
java with linux  HI , This is namit.I want to know how to link a java program with linux platform
java reflection - Development process
java reflection  how to save and run reflection class in java?please immediately reply sir
java with alfresco - Development process
java with alfresco  how to write java code to upload different documents and search options using alfresco api
java code - Development process
java code  to setup echo server and echo client.  Hi Friend, Please visit the following links: http://www.roseindia.net/java/network/ http://www.roseindia.net/java/example/java/net/udp/ Hope
java programming - Development process
java programming  Design a class for Complex numbers in Java. In addition to methods for basic operations on complex numbers, provide a method... the following link: http://www.roseindia.net/tutorial/java/core
Java programing - Development process
Java programing  1.What is system.out and system.in? 2.write down the steps to run Java application 3.what are the function of the following methods a.show input dialogue message. b.show output dialogue message
Java - Development process
Programming in Java  How to program my first application in Java? Other then Hello World
Java_Weblogic - Development process
Java_Weblogic  How to run as service bea weblogic server on unix mode
java - Development process
java  Develop multi-threaded echo server and a corresponding GUI client in Java
java - Development process
java  how to store the names in database in binary tree format using the java code
java project - Development process
java project   Can you tell me how to design a windmill software
java charts - Development process
java charts  Hi,i want to create charts wrt database by using jsp?please help me
java - Development process
java  Could you please explain me how to use composite primary key in the java persistent api with example
java beginning - Development process
java beginning  sir, i am literaly a beginner and i just want to askthat what are the uses of learning java because i have listened about... the following links: http://www.roseindia.net/java/ http://www.roseindia.net/java
Java - Development process
Java   hi everybody, my problem is how to produce commandprompt through java code and how to open a particular .exe file with this code...plz could any one solve my problem....waiting for the reply,..... thank
java script - Development process
java script  how could i devlop code for create widget. i need to generate java script that if paste to any other web site will generate the widget. a widget can contain image text video or combination
Java Project - Development process
Java Project  Hello Sir I want Java Project for Time Table of Buses.that helps to search specific Bus Time and also add ,Update,Delete the Bus Routes. Back End MS Access Plz Give Me
java - Development process
java  Develop Date class in Java similar to the one available in java.util package. Use JavaDoc comments and the output.please reply must sir. .../tutorial/java/core/implementDateclass.html Thanks

Ads