How to get the list of java processes along with their PID(process id) that are running on UAT server under a specfic account?
Problem:
A jar file was failed to deploy on a UAT server.
Reason:
Because when we are trying to rename it,it is showing "cannot rename the file it is been used by another user".
step choosen in order to solve the problem
log on UAT server(xxx). we need the list of java processes along with the PID on our UAT server which is running under the account XXXAPPFUNC. Pl开发者_StackOverflow中文版ease tell me how can I do this? Thanks in Advance.Did you try the jps
tool?
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* ] ]
For example, to list the instrumented JVMs on the local host:
$ jps 18027 Java2Demo.JAR 18032 jps 18005 jstat
Run it under the desired account.
Have you tried Process Explorer "Ever wondered which program has a particular file or directory open? Now you can find out. Process Explorer shows you information about which handles and DLLs processes have opened or loaded." Doesn't just work for java processes.
精彩评论