DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • A Systematic Approach for Java Software Upgrades
  • Building a Simple RAG Application With Java and Quarkus
  • Dust Actors and Large Language Models: An Application
  • Five Java Developer Must-Haves for Ultra-Fast Startup Solutions

Trending

  • Breaking Bottlenecks: Applying the Theory of Constraints to Software Development
  • Intro to RAG: Foundations of Retrieval Augmented Generation, Part 1
  • *You* Can Shape Trend Reports: Join DZone's Software Supply Chain Security Research
  • Java Virtual Threads and Scaling
  1. DZone
  2. Coding
  3. Java
  4. Quickly Find Your Java Application Process ID

Quickly Find Your Java Application Process ID

We 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.

By 
Ram Lakshmanan user avatar
Ram Lakshmanan
DZone Core CORE ·
Mar. 23, 21 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
25.5K Views

Join the DZone community and get the full member experience.

Join For Free

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.

Finding Java Application Process ID in Linux

 On any Linux/Unix flavor of operating system, issue the command:

ps -ef | grep java


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

Fig: 'ps' command displaying all Java processes running on Linux machine.

The 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 the 'jps' command:

 1. Open the command prompt.

 2. cd to 'bin' folder, where JDK is installed.

 3. Issue 'jps' command.

Example:

cd C:\Program Files\Java\jdk1.8.0_181\bin jps


When the above command was issued, the following was the output:

'jps' command displaying all Java processes running on a windows machine

Fig: 'jps' command displaying all Java processes running on a windows machine.

The 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 the 'ps' command in Linux (the example is 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.

Java (programming language) application Command (computing)

Opinions expressed by DZone contributors are their own.

Related

  • A Systematic Approach for Java Software Upgrades
  • Building a Simple RAG Application With Java and Quarkus
  • Dust Actors and Large Language Models: An Application
  • Five Java Developer Must-Haves for Ultra-Fast Startup Solutions

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!