How to run RMI Registry through java code?

I wrote java programs for Client and Server. But to run the program, I need to run the rmi registry manually! How to run the RMI registry through java code (through the server)?

+5
source share
2 answers

Use LocateRegistry.createRegistry(port). See javadoc .

+11
source

First, you need to run “run rmiregistry” in the java bin folder through the shell / command line (create the CLASSPATH system var in the java class / jar for the project to register in the RMI Register, the RMI Registry must know its classes).

Before you can use LocateRegistry.getRegistry ().

-1
source

All Articles