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")
- 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 processchild 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
Advertisements
BIRT reporting tool - Development processBIRT 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 processJava process How will you invoke any external
process in
Java Process in JavaProcess 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
java tooljava tool I installed edit plus
tool but it couldn't compile and excute the coding ...how to retify that problem
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
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 7java 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 processjava 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
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 Beginnersjava 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 Beginnersjava 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 xmlReading
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 toolJAVA 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 10Installing 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 10Installing 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 - CVSTool 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 processjava 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 JavaHow 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 code - Development processjava 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 processjava 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 processJava 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 processjava Could you please explain me how to use composite primary key in the
java persistent api with example
java beginning - Development processjava 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 processJava 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 processjava 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 processJava 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 processjava 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