Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI Server from client in eclipse

 
Ivo Tantamango
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, thanks for reading this, well this is what happens, i have a RMI server (objRMI.jar) in a folder in my computer which i created and compiled from line commands, and i have an android application in eclipse IDE, now i want that my android application in eclipse works as a client for the RMI server that i have in another directory, the thing is that i don't know how to set the classpath to objRMI.jar, and also call the interface in the server i been doing it through commands lines from another client in the same directory like this
set CLASSPATH=%CLASSPATH%;.\objRMI.jar;.
but i dont know how to do it in eclipse
the invocation in the client that i have in the same diretory where the server is, is like this:
MyRMIinterface mri = (MyRMIinterface)java.rmi.Naming.lookup("//" +args[0] + ":" + args[1] + "/TestRMI");
but in eclipse, because they are not in the same directory it shows me an error, that i have to create the class MyRMIinterface.
i also want to be able to run a client in one machines to connect to the RMI server in another machine.
 
Edward Harned
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just open Run Configurations and add the jar file pointer there.
 
Ivo Tantamango
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, that's one thing that i could do for setting the path, but when im invoking the interface it shows me an error because that interface is not in the same directory, im wondering on how to do it i separate machines.
 
Edward Harned
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Everything you can do on a command line you can do with the Run Configurations.
 
Ivo Tantamango
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I already solved using sockets, thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic