【发布时间】:2015-02-18 10:57:31
【问题描述】:
这里是 MyRemoteImplement.java 文件:
import java.rmi.*;
import java.rmi.server.*; //for UnicastRemoteObject
public class MyRemoteImplement extends UnicastRemoteObject implements MyRemote
{
public String sayHello()
{
return "Remote server says hello";
}
public MyRemoteImplement() throws RemoteException
{
;
}
public static void main(String[] args)
{
try
{
MyRemote server = new MyRemoteImplement();
Naming.rebind("Remote Hello Server", server);
}
catch(Exception rex)
{
System.out.println("Error when registering server.");
}
}
}
我编译这段代码得到MyRemoteImplement.class
然后我导航到包含文件MyRemoteImplement.class 的目录并在命令行中运行以下命令(Windows XP):
rmic MyRemoteImplement
根据我正在阅读的教科书,由于运行上述命令,存根代码和框架代码都必须在同一目录中生成。
但是,我只生成了存根文件 MyRemoteImplement_stub.class,没有生成骨架代码。
为什么没有生成骨架代码? 怎么整?
【问题讨论】: