Search code examples
javarmi

Java RMI external jar


I am developing a demonstration in java using RMI, so I will have a server and a few clients connecting to that server.

I am currently doing this in UNIX, and opening these in terminals can be a bit tedious. I was wondering if it is possible to have the server in a jar and the client in another jar file. More specifically, do I need to take special precautions when specifying the class path for RMI etc ? What are the possible complications for this?


Solution

  • You will normally have three JAR files:

    1. Server code.
    2. Client code.
    3. Code that is common to both, e.g. the remote interface, the stub if you're generating them, and any classes that the remote interface depends on, and so on until closure.

    (1) and (2) should name (3) in the Class-path entries of their Manifests.