This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Rmi Hello World example

 
Bor Kev
Greenhorn
Posts: 17
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to run the basic Hellow World example discussed at https://docs.oracle.com/javase/8/docs/technotes/guides/rmi/hello/hello-world.html.

My point is to run it on two different machines with two different JVM . Both computers (Machine A and Machine B) have Windows 10 operating system and run Java 8. I compiled and ran the Hello.java and Server.java on Machine B. Everything went fine and perfect and I could even start the Java RMI registry and the server on that same machine. Everything happened smoothly as described in the tutorial.

However, problems started when I tried to compile Client.java on Machine A. When I tried to compile Client.java on Machine A, the compiler says "error cannot find symbol Hello". Any ideas how I could fix this please?

Below the source code :

Interface Hello on Machine B



Class Server on Machine B



Class Client on Machine A



Sincerely,

borkev
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bor Kev wrote:However, problems started when I tried to compile Client.java on Machine A.


Why would you do that? You already have compiled versions of the classes on Machine B. Just copy them over.
 
Bor Kev
Greenhorn
Posts: 17
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Paul Clapham,

They actually suggest in the tutorial to compile all three classes (i.e Client.java, Server.java and Hello.java ) on the same machine. However, I do not understand the point. I thought the point of RMI was to be able to have remote objects being requested from a different JVM. This is why I am trying to have Client.java on a different JVM requesting remote objects from Server.java and Hello.java on a different machine. I am new to the concept so I apologize if this does not make sense for more experienced programmers.
Any ideas on how to fix this other than having all three classes compiled on the same machine please?

Sincerely,

borkev
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bor Kev wrote:I thought the point of RMI was to be able to have remote objects being requested from a different JVM.


Yes, that's correct.

This is why I am trying to have Client.java on a different JVM requesting remote objects from Server.java and Hello.java on a different machine.


No, that's not correct. The source code is not where you get objects from. It's the compiled classes where you get objects.

I am new to the concept so I apologize if this does not make sense for more experienced programmers. Any ideas on how to fix this other than having all three classes compiled on the same machine please?


If you're bound and determined to spend your time compiling your code on both machines -- something which no RMI user would ever bother doing -- then sure, go ahead and do that. You just need to duplicate your development environment on both machines.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!