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 7589861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:16:00+00:00 2026-05-30T20:16:00+00:00

I am trying to develop a log file watchdog C# service to restart a

  • 0

I am trying to develop a log file watchdog C# service to restart a Java application.

This Java application runs a special communication program and writes collected data to a log file. It is currently being started with a batch file script.

I want my C# service to monitor whether or not the log file is updated with new data. If it isn’t getting new data, I want to restart the Java application.

I have found material online about calling batch scripts in C# applications and checking when files are modified, but I was wondering if their is a way to terminate the currently running Java Program using a C# application? The Java programs name is javaw.exe, but their are other Java programs running on this machine so it isn’t unique. Does anyone have any idea on how to accomplish this?

  • 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-05-30T20:16:01+00:00Added an answer on May 30, 2026 at 8:16 pm

    jps -v is a Java command which details out the processes which are being used by java. If you make this call via c# and pass the information into a string, you can sort through this and determine precisely which process you’d like to kill.

    You can take in the output like so:

            ProcessStartInfo psi = new ProcessStartInfo("jps", "-v");
            psi.RedirectStandardOutput = true;
            psi.UseShellExecute = false;
            Process p = new Process();
            p.StartInfo = psi;
            p.Start();
            string[] output = p.StandardOutput.ReadToEnd().Split("\n".ToCharArray());
    

    After this, you can easily parse out the Process ID and Name of the Java process you’re running.

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

Sidebar

Related Questions

I am trying to develop an online translation service (sort of a personal challenge)
I am trying to develop an application to search through the receive calls in
We are trying to develop a timeout feature in application where we want alert
I'm trying to develop an Android application but when I try to connect to
Iam trying to develop a web application, where when a button is clicked the
im trying to develop a social networking application and im having some trouble showing
I’m trying to develop an Android application for a medical device using Bluetooth (SPP).
I'm trying to develop ORM for database synchronisation and decided to give Java reflection
we are trying to develop a web application framework and build implementatins on top
I'm trying to develop a little C# application (with MS Visual Express and SQL

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.