Original Post
I'm trying to write an hello world rmi application, but I keep getting an error java.lang.ClassNotFoundException: javainterface Why do i get this error? and how do I solve it? I have 3 classes: main.java
import java.*;
import java.math.BigInteger;
import java.rmi.*;
public class main
{
public static void main (String[] argv)
{
// Create and install a security manager
if(System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}
try {
Naming.rebind ("rmi://127.0.0.1:1099/", new hello ("Hello, world!"));
System.out.println ("Hello Server is ready.");
} catch (Exception e) {
System.out.println ("Hello Server failed: " + e);
}
}
}
javainterface.java
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface javainterface extends Remote
{
public String say() throws RemoteException;
}
and hello.java
import java.rmi.*;
import java.rmi.server.*;
public class hello extends UnicastRemoteObject implements javainterface
{
private String message;
public hello (String msg) throws RemoteException {
message = msg;
}
public String say() throws RemoteException {
return message;
}
}
I have rmiregistry running and Im using eclipse ide. [Edited by - frankfrank on May 28, 2009 6:00:09 AM]