美文网首页
window编译

window编译

作者: 思记享 | 来源:发表于2021-04-14 10:57 被阅读0次

https://www.cnblogs.com/qianjinyan/p/10772540.html

taskkill是Windows命令行里终止指定程序“进程”的命令。

/f 表示强制终止
/im 表示指定的进程名称,例如“explor.exe"

/pid 表示指定的进程ID进程号

taskkill /f /im javaw.exe
taskkill /f /pid 3352

参考jenkins的部分代码,发现其使用了如下的工具包,经验证该工具获取的pid和windows任务管理器看到的也不一样,但是通过其关闭方法却可以关闭进程,还没弄清楚这个pid和任务管理器里面看到的pid有什么不同。

<dependency>
            <groupId>org.jvnet.winp</groupId>
            <artifactId>winp</artifactId>
            <version>1.28</version>
        </dependency>

if (File.pathSeparatorChar == ';' || OSUtil.osEnum == OSEnum.Windows ) {
                WindowsProcessUtil.killRecursively(process, runJobId);
            }

public static void killRecursively(Process process,Long runJobId) {
        String logKey = "killAllChildProcess,runJobId=" + runJobId + ",";
        WinProcess winProcess = new WinProcess(process);
        int rootPid = winProcess.getPid();
        LogUtil.info(logKey + "rootPid=" + rootPid);
        if (rootPid < 1) {
            LogUtil.error(logKey + "rootPid=" + rootPid + ",should not less than 1 ");
            return;
        }
        winProcess.killRecursively();
    }

相关文章

  • window编译

    https://www.cnblogs.com/qianjinyan/p/10772540.html[https:...

  • 十六 this

    函数预编译过程 this --> window 全局作用域 this --> window cal...

  • c++编译跨平台动态库

    window编译动态库 linux编译动态库 makefile文件

  • [JavaScript基础] this,arguments

    函数预编译过程 this 指向 window 全局作用域 this 指向 window call / apply ...

  • javascript中对this的理解

    //1.函数预编译过程中 this --> window //AO this: window function t...

  • JS(十七)this

    写在最前面 this 函数预编译过程 this --> window 全局作用域里 this --> window...

  • Mac m1的交叉编译

    Mac M1交叉编译问题 最近刚从window转到Mac系统,用Mac交叉编译window程序时遇到一点问题。 配...

  • Window 编译Openssl

    1). 安装NDK 2). openssl-android 3). 修改版本 进入openssl-android目...

  • OpenCv库的精简

    1.在window上用cmake编译opencv for Android 编译Android平台的opencv 这...

  • go 语言学习

    Golang 在 Mac、Linux、Windows 下如何交叉编译 Mac 下编译 Linux 和 Window...

网友评论

      本文标题:window编译

      本文链接:https://www.haomeiwen.com/subject/zwgikltx.html