I have created a Server, Client kind of program with RMI. But whenever I run my Server after starting the rmiregistry from command prompt, the port already in use error is t
The rmiregistry is using port 1099 in its process so you can't use it in yours. Either:
rmiregistry
LocateRegistry.createRegistry()