How to kill firefox child process/tab from Java/C++

后端 未结 3 401
没有蜡笔的小新
没有蜡笔的小新 2021-01-14 14:16

I have my application in Java which invokes a browser [IE or Firefox etc ] ..

Requirement is when my Java Application exits i have to kill all the web pages [Child p

3条回答
  •  無奈伤痛
    2021-01-14 15:07

    try using pkill (killing by process name) command.

    Runtime.getRuntime().exec("pkill firefox");
    

    or in c++

    system("pkill firefox");
    

    But it's not platform independent. It will run on Unix-like operating system, and not in windows.

提交回复
热议问题