singleton - Get instance of same Java application if it is already running -


is possible check if java application running , if is, instance of it? have jar first time it's clicked opens frame, , every time after (until it's closed), gets frame , adds object it. needs work without main application having close() method application work again when reopened if stops responding or has been closed task manager.

java applications works on different process.

so not easy interact between 2 different process (already running application , new one).

what can find inter process communication mechanism , use it. typical inter process communications use files or common database.

you can store id of current main thread executing java app.

if new process starts check if there running application. if yes, can use same (or new one) inter process communication system send information main process should update. secondary process kill itself.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -