How to start RMI Registry through java code?

对着背影说爱祢 提交于 2021-02-06 05:01:46

问题


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)?


回答1:


Use LocateRegistry.createRegistry(port). See javadoc.




回答2:


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().



来源:https://stackoverflow.com/questions/10447300/how-to-start-rmi-registry-through-java-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!