• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Trying to kill all associated threads and processes

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
'Ello,

I search the forums a bit and tried a few things, but I still have a problem.

I have a simple java app which I use as a wrapper to a command line interface tool (ClearCase if you want to you).

I create a thread and then I make a system call to the command. This command I am executing launches a GUI tool.

When I press my button to execute the system command within my thread, I can not find a way to kill that system call process. No matter what I do, if I kill my Java window, that system call will execute and a few seconds later even though my java app is closed down, the gui tool from the system call pops up.

I want to be able to kill all spawned processes and threads associated with my app. I thought System.exit() would do it. I even tried to call destroy() from my Process object created from:




Any ideas? thanks for your time.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds right. The Process doc says

The subprocess is not killed when there are no more references to the Process object, but rather the subprocess continues executing asynchronously.

There is no requirement that a process represented by a Process object execute asynchronously or concurrently with respect to the Java process that owns the Process object.



Bummer that Process.destroy() does not kill your process. I'd expect that to be unreliable as it counts on the process listening for some signal.
[ July 01, 2006: Message edited by: Stan James ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic