当我尝试使用:rmic RemoteMethodImpl生成存根文件时
我收到以下错误:

error: File .\RemoteMethodImpl.class does not contain type RemoteMethodImpl as expected, but type InterfaceImplementation.RemoteMethodImpl. Please remove the file, or make sure it appears in the correct subdirectory of the class path.
error: Class RemoteMethodImpl not found.
2 errors


这是什么错误?我为什么得到这个?

应@ Shashank Kadne的要求

package InterfaceImplementation;
import Interfaces.RemoteMethodIntf;
import java.rmi.server.UnicastRemoteObject;
import java.rmi.RemoteException;
import Design.Main_Design_Client;
/**
 *
 * @author program-o-steve
 */
 public class RemoteMethodImpl extends UnicastRemoteObject implements RemoteMethodIntf{
  public RemoteMethodImpl() throws Exception{}

@Override
public void send(String IP,String Message) throws RemoteException {
  Main_Design_Client mdc = new Main_Design_Client();
  mdc.jTextArea1.setText("<html><b>Message from :</b></html>" + IP);
  mdc.jTextArea1.setText("<html><b>Message :</b></html>" + Message);
}


}

最佳答案

我假设您位于“ InterfaceImplementation”文件夹外的目录中。

执行:rmic InterfaceImplementation.RemoteMethodImpl

07-25 21:29