Hi,
As part of getting up to speed with RMI for the OCJD I am playing around with some examples. I am having difficulty getting an RMI example running in Eclipse, can anyone help?
The example that I am trying to run is from this page here
http://download.oracle.com/javase/6/docs/technotes/guides/rmi/hello/hello-world.html
I compiled all the classes from this example into "F:\classes", so they exist in "F:\classes\example\hello". I have the following structure:
The example runs from the command line when I do the following:
1. Run rmiregistry from a command window, where the directory is somewhere other than where the code is located, and CLASSPATH is blank.
2. Run the server using the command, which is run from the directory "F:":
java -classpath classes -Djava.rmi.server.codebase=file:F:/classes/ example.hello.Server
3. Run the client using the command below run from the directory "F:" :
java -cp classes example.hello.Client
Now, when I copy all the files to Eclipse it no longer runs for me. The directory structure in Eclipse is:
So, I first start the rmiregistry from a command window, where the directory is somewhere other than where the code is located, and CLASSPATH is blank.
Then I attempt to run the Server class in Eclipse. I set the VM arguments to include the following:
-Djava.rmi.server.codebase=file:F:\RMI\classes
But then I get this error below. Any ideas why the class
example.hello.Hello cannot be found?
Below is the code that I am trying to run, I've only included the Server class, the Client class and Hello interface are on the link I mentioned above.