java - How to close the javax application if the same instance is already running? -
i running java application jar file. need forces me check other instance of same application running or not on same machine. e.g must restrict run 1 instance of application make run, close other application (if running on other tab on terminal). have searched similar threats here, unable figure out.
the easiest way achieve create lock-file when start application. when start second instance can check existence of such file , terminate if 1 found. when close first instance has delete file of course before terminates.
Comments
Post a Comment