next up previous contents
Next: Compiling and running the Up: The Graphical User Application Previous: The Graphical User Application   Contents

Compiling and running the Server Code

The server code is available at this location (http://www.redbrick.dcu.ie/ hego/project/gui_server1.tar.bz2). Download this code into a destination directory. Unzip and untar the file with the following command;

bzip2 -d gui_server1.tar.bz2
tar xvf gui_server1.tar

The java code is stored in the directory com/jcraft/weirdx. To compile this code type;

javac com/jcraft/weirdx/*.java

An RMI stub file then needs to be generated for the Spy class. This can be generated with the following command;

rmic com.jcraft.weirdx.Spy

The logins.c file then needs to be compiled, and the source moved to the /tmp subdirectory. Assuming the gcc compiler is installed on the system, this can be compiled by;

gcc logins.c -o logins
mv logins /tmp

The java policy file then needs to be altered. A sample java.policy file is included with the server code. This needs to be modified to reflect the source directory;


\begin{lstlisting}[frame=trbl,caption=java.policy]{}
grant {
permission java.ne...
... java.io.FilePermission ''<<ALL FILES>>'', ''read,execute'';
};
\end{lstlisting}


Before the server can be run, the rmiregistry must be started on port 8000. This is done with the following command;

rmiregistry 8000 &

Finally, a sample server file that starts the server code is included called "server4.sh". This should again be modified to reflect the system.
\begin{lstlisting}[frame=trbl,caption=server4.sh]{}
...


next up previous contents
Next: Compiling and running the Up: The Graphical User Application Previous: The Graphical User Application   Contents
Colm O hEigeartaigh 2003-05-30