【问题标题】:Why is the MyRemoteImplement_Skel.class not generated when rmic MyRemoteImplement is run in the terminal?为什么在终端运行 rmic MyRemoteImplement 时没有生成 MyRemoteImplement_Skel.class?
【发布时间】: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,没有生成骨架代码。

为什么没有生成骨架代码? 怎么整?

【问题讨论】:

    标签: java rmi stub


    【解决方案1】:

    您正在阅读的教科书已经过时了 16 年。骷髅自 1998 年以来就没有自动生成。你不需要一个。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-17
      • 2016-12-02
      • 1970-01-01
      • 1970-01-01
      • 2022-01-23
      • 1970-01-01
      相关资源
      最近更新 更多