/>

### RCFProto Java Demo

This section describes how to build and run the RCFProto Java demo server and client, on Unix platforms. You will need the source distribution to follow these steps.

##### Prerequisites

Make sure you have the following prerequisites installed. The commands listed below show how to install the prerequisites on Ubuntu Linux.

- C++ compiler (g++ or similar):
`sudo apt-get install g++`
- cmake:
`sudo apt-get install cmake`
- Boost:
`sudo apt-get install libboost-dev`
- zlib:
`sudo apt-get install zlib1g-dev`
- OpenSSL:
`sudo apt-get install libssl-dev`
- JDK:
`sudo apt-get install openjdk-6-jdk`
- Protocol Buffers Java libraries:
`sudo apt-get install libprotobuf-java`

##### Building RCFProto Java bindings

- From the root directory of the distribution, run cmake to generate the makefile:
`mkdir make`
`cd make`
`cmake -G "Unix Makefiles" ..`
- Run make:
  `make`
- The `java/bin/x86` or `java/bin/x64` directory should now contain `libRCFProto_Java_impl.so`, and `java/bin` should contain `RCFProto.jar` .

##### Building the Java demo server and client

- From the root directory of the distribution, cd to the demo directory:
`cd java\demo`
- Generate source code for Protocol Buffer messages:
`protoc Demo.proto --java_out=.`
- Create directory for class files:
`mkdir class`
- Build demo server and demo client (the following command assumes the Protocol Buffers Java library is installed to `/usr/share/java/protobuf.jar`):
`javac -classpath ../bin/RCFProto.jar:/usr/share/java/protobuf.jar -d class DemoServer.java DemoClient.java Proto.java DllPathResolver.java`

##### Running the Java demo server and client

- Cd to the class directory where the demo server and client have been built to:
`cd class`
- Run the demo server:
`java DemoServer`
- Run the demo client (in a different command prompt):
`java DemoClient`