java/shellscript code to find out if a jar file is already running on current machine
How do I find out if a specific JAR file is running on my machine or not? I just want to ensure that a specific JAR is only executed once at any time-- so if another request to execute the same jar comes in then I should not again invoke that jar. I can use code for the above either as java code (which I will add to that JAR itself) or as shellscript (which I will use to invoke the jar file). The machine will be a Linux machine-- either CentOS, or Debian or Ubuntu or Amazon Linux. jps is a simple command-line tool that prints out the currently running JVMs and what they're running. You can