title: The type java.io.ObjectInputStream cannot be resolved (eclipse)
body: <p>I'm trying to do a simple client server program using Java RMI through Eclipse (version Helios Service Release 1). For the server side, I defined an interface, and a class that implements that interface. In the class I imported java.rmi.<em>, and java.rmi.server.</em> API´s so here is where I have the error</p>
  
  <blockquote>
    <p>The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files</p>
  </blockquote>
  
  <p>The version of my JRE is <code>jre1.8.0_221</code>
  I tried to configure the build path by removing and adding the JRE System Library by default, cleaning the project, creating a new project. Basically, I`ve tried most of the options provided in stackOverflow for this kind of issue.</p>
  
  <pre><code>// The Interface
  import java.rmi.*;
  public interface HelloInterface extends Remote {
      public String sayHello(String name) throws RemoteException;
  }
  
  // The class where I implement the interface
  
  import java.rmi.*;
  import java.rmi.server.*;
  
  public class HelloImpl extends UnicastRemoteObject implements 
  HelloInterface {
  
  private static final long serialVersionUID = 1L;
  
  public HelloImpl() throws RemoteException {
    super( );
  }
  
  public String sayHello(String name) throws RemoteException {
      return "Hello, World!" + name;
      }
  }
  
  // The main program
  
  import java.rmi.*;
  import java.rmi.registry.LocateRegistry;
  
  public class HelloServer{
      public static void main(String args[]){
          try {     
              int port = 16790; 
              String host = "localhost";
              HelloImpl exportedObj = new HelloImpl();
              LocateRegistry.createRegistry(port);
              String registryURL = "rmi://" + host + ":" + port + "/hello";
              Naming.rebind(registryURL, exportedObj);
              System.out.println("Hello Server ready.");
           }catch (Exception e){
               e.printStackTrace();
           }
      }
  }
  </code></pre>
  
  <p>I expect the output <code>Hello Server Ready</code>, but the program does not compile showing the error:</p>
  
  <blockquote>
    <p>The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/oLigO.png" rel="nofollow noreferrer">Project Elements</a></p>