31 lines
1.2 KiB
Markdown
31 lines
1.2 KiB
Markdown
## Structure
|
|
The files are in 3 packages (directories)
|
|
|
|
1. **compute:** Package contains the interfaces. `Compute.java` and `Task.java`
|
|
2. **eingine:** package contains the server class `ComputeEngine.java`
|
|
3. **client:** package contains the client classes `Client.java` and `Operation.java`
|
|
## How to run
|
|
Each of the following commands are to be run in theit own terminal instance.
|
|
<br>i.e. open a new terminal and run the neccessary command.
|
|
1. First we compile the classeswith the output directory `out` so we have `srs` for source code and `out` for class files using the command
|
|
```bash
|
|
# this compiles any file in any directory under 'srs' in its oun parent directory under 'out'.
|
|
javac -d out $(find src -name "*.java")
|
|
```
|
|
2. Then we start the rmiregistry. since I am on linux, we do this as such:
|
|
```bash
|
|
# cd in to 'out' directory
|
|
cd out
|
|
# and start rmi registry server in the background
|
|
rmiregistry &
|
|
```
|
|
3. Start the server with the command
|
|
```bash
|
|
# this command runs the Server class 'ComputEngine'
|
|
java -cp out engine.ComputeEngine
|
|
```
|
|
4. And finally we start the client with the following command
|
|
```bash
|
|
# command runs the client class Client
|
|
java -cp out client.Client
|
|
``` |