Restricting 2 java instance running on the same machine

Hi, I need to restrict 2 instance of the same program on a single machine. how to acheive this. eg) consider a helloworld java programm run from 2 different command prompt

i need to bring the first instance on top when ever the user tries to run another instance from the same machine

any suggestions is greatly appreciated

Regards

Bala

[367 byte] By [balabaska] at [2007-9-27 9:56:24]
# 1
You can make a server thread in your 1st instance of java program. In each program's beginning, you can determine whether or not there is a server thread.If there is , send a message of moving to front to the instance and exit this instance.
totomomoa at 2007-7-8 23:43:24 > top of Java-index,Other Topics,Java Community Process (JCP) Program...