Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7979351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:45:17+00:00 2026-06-04T09:45:17+00:00

Hi all i Have two process in my java application as below. Process p1=some

  • 0

Hi all i Have two process in my java application as below.

Process p1=some process;
Process p2=some process;

At the first time it starts its working perfectly.But when i reload the application the older process is also running so i just want to kill the older process if its executing.I know that we can kill a process by using its process id.But how can i get the process id of this p1 and p2.Any idea?.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:45:18+00:00Added an answer on June 4, 2026 at 9:45 am

    Catch the reload event in your application and terminate the child process before you exit.

    If that doesn’t work, you probably have a bug in your design. Try to fix that bug. Really. I mean it.

    A workaround is to write the PID into a text file. When you start, read the text file, check if this is the correct process and then kill it.

    Without the check, you might be killing a perfectly valid process which was created by someone else. My reasoning is like so: You can’t kill the process when you reload. That means you can’t delete the text file either. So the PID file will always exist. Eventually, you will kill the wrong process. That will happen once per year. It will happen the first time six months after you left/changed job/etc. Nobody will understand what is going on because it’s almost impossible to reproduce.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two LinkedLists, I'd like to move all elements which match some criteria
I need change background of all text that have two spaces from the start
I have two entities // All details has been removed @Entity @Table(name = "A_TABLE_NAME")
I have two nsbuttons in my interface builder.For all of these three nsbuttons I
I have two table emptable1(empid,status) emptable2(empid,week) i want to select all the empid whose
I have two Entities University courses Course students i want to access all the
If I have two different arrays and all I can do is check whether
I have Two spinner(Subject and Chapter),I crate two table(Chapter,subject). I add all subject name
I have two Lists, the firs (right) represents a list of all cars and
I have two tree, which contains nodes, after I've created them, I take all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.