aspose file tools*
The moose likes Distributed Java and the fly likes RMI Server from client in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI Server from client in eclipse" Watch "RMI Server from client in eclipse" New topic
Author

RMI Server from client in eclipse

Ivo Tantamango
Greenhorn

Joined: Sep 07, 2011
Posts: 9
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

Joined: Sep 19, 2005
Posts: 291

Just open Run Configurations and add the jar file pointer there.


Ed's latest article: A Java Parallel Calamity http://coopsoft.com/ar/Calamity2Article.html
Ivo Tantamango
Greenhorn

Joined: Sep 07, 2011
Posts: 9
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

Joined: Sep 19, 2005
Posts: 291

Everything you can do on a command line you can do with the Run Configurations.
Ivo Tantamango
Greenhorn

Joined: Sep 07, 2011
Posts: 9
I already solved using sockets, thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI Server from client in eclipse