How to start RMI Registry through java code?

前端 未结 2 1067
陌清茗
陌清茗 2021-02-04 17:58

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

相关标签:
2条回答
  • 2021-02-04 18:40

    First, you need execute in java bin folder "start rmiregistry" throught shell/command line (create CLASSPATH system var to java class/jar to the project to register in RMI Register, RMI Registry need know their classes).

    Before you can use LocateRegistry.getRegistry().

    0 讨论(0)
  • 2021-02-04 18:53

    Use LocateRegistry.createRegistry(port). See javadoc.

    0 讨论(0)
提交回复
热议问题