• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Quickly find your Java application process Id

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In this post, we are going to discuss how to find your Java application process Id quickly. For certain monitoring tools like yCrash, you need to pass your application process Id as input. If you want to look for a more detailed post with several different options to find your application’s process Id, you can refer to this blog post.

Finding Java application Process Id in Linux
On any Linux/Unix flavour of Operating system issue the command:



Above command will display all the Java processes running on this machine and their arguments, process Id, and user who launched it. When I issued the above command following was the output in my AWS EC2 Linux instance:



Fig: ‘ps’ command displaying all Java processes running on Linux machine

Red color highlight in the above figure indicates the process Ids of all Java processes running on this EC2 instance. From here, you can get hold of your application’s process Id

Finding Java application Process Id in Windows
‘jps’ – Java Virtual Machine Process Status Tool is packaged in JDK. This tool will display all the Java processes that are running on that machine. Below are the steps to invoke ‘jps’ command

1. open command prompt.

2. cd to ‘bin’ folder, where JDK is installed

3. Issue ‘jps’ command

Example:


When above command was issued, following was the output:



Fig: ‘jps’ command displaying all Java processes running on windows machine

Red color highlight in the above figure indicates the process Ids of all Java processes running on this windows instance. From here, you can get hold of your application’s process Id

Note: Unlike ‘ps’ command in Linux (example given above), you will not see all the Java process arguments. One shortcoming in this approach is ‘jps’ will show only the java process’s first command. You can see all the java process arguments, only when the ‘ps’ command is issued.




 
Brace yourself while corporate america tries to sell us its things. Some day they will chill and use tiny ads.
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic