“Kill a process tree” on windows using Java

前端 未结 3 1065
闹比i
闹比i 2021-01-13 07:12

I have a Java webstart process that is part of a windows batch script. I\'m using the javaws command in a batch script in this case. This match script ( start.bat) is invoke

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-13 07:34

    Unfortunately, as you've discovered, there isn't a pure Java way of doing this. You'll have to resort to native commands or JNI libraries, all of which are platform-dependent and more complex than a pure Java solution would be.

    It may be worth upvoting the relevant bug in the Java bug database: http://bugs.sun.com/view_bug.do?bug_id=4770092

    With luck we can persuade the Java developers that the poor handling of subprocesses is worth fixing for Java 8.

提交回复
热议问题