Organizing your project directory for the client
This is what your projects/advice directory should look like after we write and compile the client code.

The Client Code (AdviceClient.java)

Compile the client:

The client needs access to the two interfaces (Advice, AdviceHome) and the two stub classes that implement those interfaces. They’re both in the client JAR the server made, but we can’t compile the client without them. The cleanest way is to add them to the classpath at compile-time, using the -classpath compiler flag.
Run the client!

At runtime, the client still needs access to the two interfaces (Advice, AdviceHome) and the two stub classes that implement those interfaces. They’re both in the client JAR the server made, we have to add them to the classpath. The best way is to use the -cp compiler flag.
Note: For now, the client must be on the same physical machine as the server. Later, we’ll see how to change this, and run the client against a J2EE server on a different machine.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access