Checking if multiple instances of a Java application are running (without preventing them)
<p>I've seen plenty of examples of how to prevent Java applications, such as locking a file or creating  a socket.</p>

<p>How do I allow multiple instances to run, but check if another one is running?</p>

<p>The reason I need to do this is that I want to clean a temporary folder on exit, but not if there is another process running.</p>
