NOTE: 1. To keep it simple, the following example demonstrates use of the RMI feature when the client and the server are running on the same machine. If you want to run them on 2 different machines, you would have to make changes to how the server is bound to the registry and how the client accesses the server. 2. While running on UNIX, use : as the path separator in calls to JAVA and JAVAC. ; is used used as path separator only for Windows. 1. MCC command to compile the Java Package component from MATLAB: mcc -v -W 'java:magiccomp,magic' myMagic.m 2. Compile the server java code from DOS/UNIX system prompt: javac -classpath \toolbox\javabuilder\jar\javabuilder.jar;\magiccomp.jar magicserver.java 3. Compile the client java code from DOS/UNIX system prompt: javac -classpath \toolbox\javabuilder\jar\javabuilder.jar;\magiccomp.jar magicclient.java 4. Running the client and server : To run the application, open 2 different DOS/UNIX windows. Make sure that for PC /bin/ is on the system path and for UNIX, LD_LIBRARY_PATH/DYLD_LIBRARY_PATH are set properly 4a. Running the server: java -classpath .;\magiccomp.jar;\toolbox\javabuilder\jar\javabuilder.jar -Djava.rmi.server.codebase="file:////toolbox/javabuilder/jar/javabuilder.jar file:////magiccomp.jar" magicserver 4b. Running the client: java -classpath .;\magiccomp.jar;\toolbox\javabuilder\jar\javabuilder.jar magicclient 5 5. Expected outputs for server and client windows: 5a. If successful, you should see the following output in the window running the server: Please wait for the server registration notification. Server registered and running successfully!! 5b. If successful, you should see the following output in the window running the client: Running the client application!! Magic square of order : 5 Receiving magic array from MATLAB : 17 24 1 8 15 23 5 7 14 16 4 6 13 20 22 10 12 19 21 3 11 18 25 2 9