问题:
在 UAT 服务器上部署 jar 文件失败。
原因:
因为当我们试图重命名它时,它正在显示
“无法重命名已被其他用户使用的文件”。
为了解决问题而选择的步骤
登录 UAT 服务器(xxx)。
我们需要 java 进程列表以及 UAT 服务器上的 PID
它在帐户 XXXAPPFUNC 下运行。
请告诉我该怎么做?
提前致谢。
最佳答案
你试过jps
了吗?工具?
DESCRIPTION
The jps tool lists the instrumented HotSpot Java Virtual Machines (JVMs) on the target system. The tool is limited to reporting information on JVMs for which it has the access permissions.
...
The list of JVMs produced by the jps command may be limited by the permissions granted to the principal running the command. The command will only list the JVMs for which the principle has access rights as determined by operating system specific access control mechanisms.
...
OUTPUT FORMAT
The output of the jps command follows the following pattern:
lvmid [ [ classname | JARfilename | "Unknown"] [ arg* ] [jvmarg* ] ]
例如,要列出本地主机上已检测的 JVM:
$ jps 18027 Java2Demo.JAR 18032 jps 18005 jstat
在所需的帐户下运行它。
关于java - 如何获取在特定帐户下在 UAT 服务器上运行的 Java 进程列表及其 PID(进程 ID)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1733504/