macos 如何在mac上找到正在运行的java进程的进程ID?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11458710/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 09:19:40  来源:igfitidea点击:

How to find the process id of a running java process on mac?

javamacosweb-applicationsjettypid

提问by user1521750

I am trying to find the PID of a java webapp on a Mac. More specifically, I am trying to find the PID for a jetty webapp running on my Desktop. I have tried using Activity monitor and searched online all to no avail.

我正在尝试在 Mac 上查找 java webapp 的 PID。更具体地说,我正在尝试为在我的桌面上运行的 jetty web 应用程序查找 PID。我曾尝试使用活动监视器并在网上搜索无济于事。

回答by Paul Sanwald

you can use jps, the Java Process Status tool:

您可以使用jps,Java 进程状态工具:

jps

which will show you, for example:

这将向您展示,例如:

13651 RemoteMavenServer

on my mac, jps lives in:

在我的 Mac 上,jps 住在:

/usr/bin/jps

回答by jesse mcconnell

Open a terminal and type jps -v

打开终端并输入 jps -v

回答by fedosov

Try to use ps aux | grep APP_NAMEin Terminal.

尝试ps aux | grep APP_NAME在终端中使用。

回答by Bruno Grieder

This works for me

这对我有用

pgrep -f jetty

pgrep -f jetty