Please see the code below:
package RMITest;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
public class HelloImpl extends UnicastRemoteObject implements Hello
{
public HelloImpl() throws RemoteException {}
public String sayHello() { return "Hello world!"; }
public static void main(String args[])
{
try
{
System.setProperty("java.rmi.server.hostname","172.16.4.142");
HelloImpl obj = new HelloImpl();
// Bind this object instance to the name "HelloServer"
Naming.rebind("HelloServer", obj);
}
catch (Exception e)
{
System.out.println("HelloImpl err: " + e.getMessage());
e.printStackTrace();
}
}
}
I am trying to follow this tutorial: https://www.cs.ucsb.edu/~cappello/lectures/rmi/helloworld.shtml#5912. The error I am getting is: ClassNotFoundException RMITest.Hello. Hello is the interface. Does the classpath need to point to the .class files or the .jar. There do not appear to be any .jar files generated by Netbeans.
I am a .NET Developer so I am quite new to this.