I have a javafx application that I packaged and installed on my pc.
The first launch of the application is working fine.
If I keep the application running, is there a way to handle the second launch of application to show the first one like skype for example ?
Thank you so much in advance
Update:
I tested the ManagementFactory example, it's only working on the IDE (I'm using netbeans) but when the application is installed(Windows 8), the class name and the command line are empty ! So the comparison is not good.
For the file locking, I'm already using this approch for protecting a file when the application is launched but it does not throw an exception when launching the second instance ! (Besides, on Oracle forum https://community.oracle.com/thread/2044019, they said if there is a power cut, the file will be still locked).
For server socket, I think it's not a good approch because it's a desktop application, so I can't guess which port is not used !