Skip to content

Instantly share code, notes, and snippets.

@bmchae
bmchae / prevent_multiple_instance_run
Created November 7, 2011 07:40
How to lock a process in java to prevent multiple instance at the same time
http://www.dscripts.net/2010/06/09/how-to-lock-a-process-in-java-to-prevent-multiple-instance-at-the-same-time/
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// check if another process is running
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
package utils;
import java.io.File;
import java.io.IOException;