• Post Reply Bookmark Topic Watch Topic
  • New Topic

How I kill a problematic Process??  RSS feed

 
Proteu Alcebidiano
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys,

Is it possible to kill a process which throws a SO's exception? I'm trying here with the System.exit(-1) command, but the java program cannot kill yourself and the process launched by this java program.

E.g.

Runtime.exec(theProcess); //This is a fail process

...

System.exit(-1); //theProcess Locks the java program, and this command is not executed...

What's the pure java solution (if exists) for this problem?

Thanks,

Proteu. :roll:
 
Sheldon Fernandes
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out this article from Java World "When Runtime.exec() won't"

There is a section on "Why Runtime.exec() hangs".

Sheldon Fernandes
[ November 16, 2004: Message edited by: Sheldon Fernandes ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!