Note that before you start the rmiregistry, you must make sure that the shell or window in which you will run rmiregistry either has no CLASSPATH environment variable set or has a CLASSPATH environment variable that does not include the path to any classes, including the stubs for your remote object implementation classes, that you want downloaded to clients of your remote objects. //Tutorial中是这么说的,我已经保证启动rmiregistry时不加任何有关rmi的东西了.可是咳异常.
Registry reg = null;
int port = xxxx;try {
reg = LocateRegistry.createRegistry(port);
}
catch(Exception e) {
e.printStackTrace();
}//bind
reg.bind("name",objectreference);
我在我的环境变量里加入RMI程序所在包的路径,才解决的。
你try把。