这是错误报考。
C:\remoteprinter\ServerPrinter.java:12: package ClientPrinter does not exist
import ClientPrinter.*;
^
C:\remoteprinter\ServerPrinter.java:14: cannot resolve symbol
symbol  : class RemotePrinter 
location: class remoteprinter.ServerPrinter
public class ServerPrinter extends UnicastRemoteObject implements RemotePrinter{
                                                                  ^
2 errorsProcess completed.

解决方案 »

  1.   

    package remoteprinter;
    /** * <p>Title: Kesney</p>
     * <p>Description: </p>
     * <p>Copyright: Copyright (c) 2003</p>
     * <p>Company: BHU VES</p>
     * @author Kesney
     * @version 0.1
     */
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.registry.*;
    import java.util.*;
    import javax.swing.*;public class ServerPrinter extends UnicastRemoteObject implements RemotePrinter{
    private static int CallTimes=0;

    public ServerPrinter() throws RemoteException{super();}   public void GoPrint() throws RemoteException{
        CallTimes+=1;
         System.out.println("Go Print for "+ CallTimes +" times!");
         //PrintSample ps = new PrintSample();
    //ps.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //ps.pack();
    //ps.setVisible(true);        
       }
      
       public static void main(String[] args) {
         try{
         System.out.println("Prepare to Start Serving! Please Wait...");
         ServerPrinter printer = new ServerPrinter();
         System.out.println("Print Server Ready! Start Serving...");
        
         /*NEW Implementation
          * Create a registry and bind stub in registry.
          */
         LocateRegistry.createRegistry(2002);
         Registry registry = LocateRegistry.getRegistry(2002);
         registry.rebind("FirstRemote", printer); /*OLD Implementation 这种方法需要外部使用rmiregistry命令
         String name= System.getProperty("Printer Name","FirstRemote");
           Naming.rebind(name,printer);
           */
           System.out.println("Server open and ready for customers!!!");
         }
    catch(Exception e){
           System.err.println(e.toString());
         }
       }
    }
      

  2.   

    这两个问题与rmi无关
    C:\remoteprinter\ServerPrinter.java:12: package ClientPrinter does not exist
    import ClientPrinter.*;------------->  找不到 ClientPrinter 这个包 !!
    ^
    C:\remoteprinter\ServerPrinter.java:14: cannot resolve symbol
    symbol  : class RemotePrinter 
    location: class remoteprinter.ServerPrinter
    public class ServerPrinter extends UnicastRemoteObject implements RemotePrinter{
    ----------〉 找不到类 RemotePrinter   建议重新整理一下你的包 和涉及到的文件!