Hi am making a program which will run through javaw.exe, so that it is not visible directly. Now my issue is sometime, (accidently) it can happen that the user runs multiple instances of the same application,
e.g entering javaw myProgram
two times
Under such situation, is there any way i can prevent multiple instances of the same program to run if the program is already running.
Comparing objects with equals() In the first comparison, equals() compares the current object instance with the object that has been passed. If the two objects have the same values, equals() will return true .
Multi-instance (MI) classification is a supervised learning technique, but differs from normal supervised learning: it has multiple instances in an example. only one class label is observable for all the instances in an example.
Although file lock is probably the simplest and easiest option, I'd like to mention one alternative: JIntellitype is a library which works only on Windows and has the utility method to check if the application window with the given title is already running.
If it just so happens that you're OK with having this functionality only on Windows and using file lock doesn't work for you... :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With