perhaps RMI, or using lock files will be the answer for you. theres even
the posibility of having a socket server, so that when the program runs
it contacts a server on a specific port, the server then announces that
a client is running when all future connects are attempted.