InstallationJava » History » Version 7
S. Wrede, 09/05/2011 11:20 AM
1 | 5 | J. Moringen | h1. Installation of RSB Java Implementation |
---|---|---|---|
2 | 1 | S. Wrede | |
3 | 5 | J. Moringen | For compilation and installation of the Java implementation, we use the "Ant":http://ant.apache.org/ build tool. |
4 | 1 | S. Wrede | |
5 | 5 | J. Moringen | h2. Dependencies |
6 | 1 | S. Wrede | |
7 | 5 | J. Moringen | h3. Dependencies on Externals Libraries and Tools |
8 | 5 | J. Moringen | |
9 | 5 | J. Moringen | Required: |
10 | 5 | J. Moringen | * "CMake":http://www.cmake.org/ (tested with CMake version 2.8) |
11 | 1 | S. Wrede | * libprotobuf-java |
12 | 1 | S. Wrede | * ant |
13 | 5 | J. Moringen | * Daemon program of the "Spread group communication system":http://www.spread.org/ |
14 | 5 | J. Moringen | |
15 | 5 | J. Moringen | Optional: |
16 | 1 | S. Wrede | ** javadoc |
17 | 1 | S. Wrede | |
18 | 5 | J. Moringen | h3. Dependencies on other RSB Sub-projects |
19 | 5 | J. Moringen | |
20 | 5 | J. Moringen | The Java implementation of RSB depends on RSB's language independent network protocol specification. This specification is maintained in the "protocol sub-project of the RSB source tree":https://code.cor-lab.org/projects/rsb/repository/show/trunk/protocol. |
21 | 5 | J. Moringen | |
22 | 5 | J. Moringen | Assuming the entire RSB source tree has been checked out into the current directory, the protocol sub-project can be built and installed using the following commands (@$prefix@ has to be replaced with a desired installation prefix): |
23 | 5 | J. Moringen | <pre> |
24 | 5 | J. Moringen | cd protocol/build && cmake .. -DCMAKE_INSTALL_PREFIX=$prefix && make && make install |
25 | 5 | J. Moringen | </pre> |
26 | 5 | J. Moringen | |
27 | 1 | S. Wrede | h2. Installation of RSB Core |
28 | 1 | S. Wrede | |
29 | 5 | J. Moringen | *After installing the protocol sub-project* (see above) |
30 | 5 | J. Moringen | # Checkout code from Subversion repository (see "front page":https://code.cor-lab.org/projects/rsb) |
31 | 5 | J. Moringen | # Invoke @ant@ supplying build properties on the commandline or via @build.properties@ (see below) |
32 | 4 | S. Wrede | |
33 | 5 | J. Moringen | The following properties are used to configure the build: |
34 | 5 | J. Moringen | |_.Ant Property |_.Meaning |_.Example | |
35 | 5 | J. Moringen | | @prefix@ | Location into which RSB should be installed | @/vol/cit/share@ | |
36 | 5 | J. Moringen | | @pbuf.protoc@ | Location of protocol buffer compiler (@protoc@ or @protoc.exe@ | @/usr/bin/protoc@ | |
37 | 5 | J. Moringen | | @pbuf.protopath@ | Location of RSB protocol IDL files (see TODO) | @/vol/cit/share/RSBProtocol@ | |
38 | 5 | J. Moringen | | @pbuf.lib@ | Location of Java protocol buffer runtime library | @/usr/share/java/protobuf.jar@ | |
39 | 5 | J. Moringen | | @spread.daemon@ | Location of Spread Daemon Executable | @/vol/cit/sbin/spread@ | |
40 | 1 | S. Wrede | |
41 | 5 | J. Moringen | All properties can be supplied on the @ant@ commandline using the @-DNAME=VALUE@ syntax or by creating a @build.properties@ file containing lines of the form @NAME = VALUE@. |
42 | 1 | S. Wrede | |
43 | 5 | J. Moringen | An exemplary @ant dist@ command, which builds the RSB jar library, may look as follows: |
44 | 1 | S. Wrede | <pre> |
45 | 1 | S. Wrede | ant -Dpbuf.protoc=/usr/bin/protoc -Dpbuf.protopath=/vol/cit/share/RSBProtocol -Dpbuf.lib=/usr/share/java/protobuf.jar -Dspread.daemon=/vol/cit/sbin/spread dist |
46 | 1 | S. Wrede | </pre> |
47 | 5 | J. Moringen | The equivalent @build.properties@ file looks like this: |
48 | 5 | J. Moringen | <pre> |
49 | 5 | J. Moringen | pbuf.protoc = /usr/bin/protoc |
50 | 5 | J. Moringen | pbuf.protopath = /vol/cit/share/RSBProtocol |
51 | 5 | J. Moringen | pbuf.lib = /usr/share/java/protobuf.jar |
52 | 5 | J. Moringen | spread.daemon = /vol/cit/sbin/spread dist |
53 | 5 | J. Moringen | </pre> |
54 | 5 | J. Moringen | In the presence of this file, the @ant@ command reduces to |
55 | 5 | J. Moringen | <pre> |
56 | 5 | J. Moringen | ant dist |
57 | 5 | J. Moringen | </pre> |
58 | 1 | S. Wrede | |
59 | 6 | S. Wrede | In order to test your freshly compiled RSBJava version, you may execute the RSBJava test suite. To do so, the following @ant@ target needs to be invoked (please note that a spread daemon is automatically started by the ant script): |
60 | 6 | S. Wrede | |
61 | 6 | S. Wrede | <pre> |
62 | 6 | S. Wrede | ant test |
63 | 6 | S. Wrede | </pre> |
64 | 6 | S. Wrede | |
65 | 6 | S. Wrede | You should see a console output similar to the following (shortened excerpt): |
66 | 6 | S. Wrede | |
67 | 6 | S. Wrede | <pre> |
68 | 6 | S. Wrede | ubi-1-165-178:RSBJava swrede$ ant -Dpbuf.protoc=/opt/local/bin/protoc -Dpbuf.protopath=/vol/cit/share/RSBProtocol -Dpbuf.lib=/opt/local/share/java/protobuf.jar -Dspread.daemon=/vol/cit/sbin/spread test |
69 | 6 | S. Wrede | Buildfile: /Users/swrede/Workspace/RSBJava/build.xml |
70 | 6 | S. Wrede | |
71 | 6 | S. Wrede | init: |
72 | 6 | S. Wrede | [echo] Using pbuf: /opt/local/share/java/protobuf.jar |
73 | 6 | S. Wrede | [echo] Test report dir: /Users/swrede/Workspace/RSBJava/testreports |
74 | 6 | S. Wrede | |
75 | 6 | S. Wrede | protocol: |
76 | 6 | S. Wrede | |
77 | 6 | S. Wrede | compile: |
78 | 6 | S. Wrede | [javac] /Users/swrede/Workspace/RSBJava/build.xml:105: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds |
79 | 6 | S. Wrede | [javac] Compiling 1 source file to /Users/swrede/Workspace/RSBJava/build/classes |
80 | 6 | S. Wrede | [javac] /Users/swrede/Workspace/RSBJava/build.xml:110: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds |
81 | 6 | S. Wrede | [javac] Compiling 1 source file to /Users/swrede/Workspace/RSBJava/build/examples |
82 | 6 | S. Wrede | |
83 | 6 | S. Wrede | test-compile: |
84 | 6 | S. Wrede | [javac] Compiling 25 source files to /Users/swrede/Workspace/RSBJava/build/test |
85 | 6 | S. Wrede | |
86 | 6 | S. Wrede | test: |
87 | 6 | S. Wrede | [junit] Running rsb.DefaultErrorHandlerTest |
88 | 6 | S. Wrede | [junit] Testsuite: rsb.DefaultErrorHandlerTest |
89 | 6 | S. Wrede | [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0,083 sec |
90 | 6 | S. Wrede | [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0,083 sec |
91 | 6 | S. Wrede | [junit] ------------- Standard Error ----------------- |
92 | 6 | S. Wrede | [junit] 05.09.2011 11:12:38 rsb.DefaultErrorHandler warning |
93 | 6 | S. Wrede | [junit] SCHWERWIEGEND: A warning was reported to the ErrorHandler: java.lang.RuntimeException: test |
94 | 6 | S. Wrede | [junit] 05.09.2011 11:12:38 rsb.DefaultErrorHandler error |
95 | 6 | S. Wrede | [junit] SCHWERWIEGEND: An error was reported to the ErrorHandler: java.lang.RuntimeException: test |
96 | 6 | S. Wrede | [junit] ------------- ---------------- --------------- |
97 | 6 | S. Wrede | |
98 | 6 | S. Wrede | <output of more tests omitted> |
99 | 6 | S. Wrede | |
100 | 6 | S. Wrede | [junit] Running rsb.util.UUIDToolsTest |
101 | 6 | S. Wrede | [junit] Testsuite: rsb.util.UUIDToolsTest |
102 | 6 | S. Wrede | [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0,164 sec |
103 | 6 | S. Wrede | [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0,164 sec |
104 | 6 | S. Wrede | [junit] |
105 | 6 | S. Wrede | [junit] Testcase: testGetNameBasedUUID took 0,069 sec |
106 | 6 | S. Wrede | [junit] Testcase: testByteArrayConversion took 0,001 sec |
107 | 6 | S. Wrede | |
108 | 6 | S. Wrede | BUILD SUCCESSFUL |
109 | 6 | S. Wrede | Total time: 48 seconds |
110 | 6 | S. Wrede | </pre> |
111 | 6 | S. Wrede | |
112 | 6 | S. Wrede | If no failed test cases are reported, RSBJava works correctly on your machine. |
113 | 6 | S. Wrede | |
114 | 5 | J. Moringen | To install RSB jars into the configured prefix (e.g., into @${prefix}/share/java@), the following @ant@ command can be used |
115 | 5 | J. Moringen | <pre> |
116 | 5 | J. Moringen | ant install |
117 | 5 | J. Moringen | </pre> |
118 | 4 | S. Wrede | |
119 | 4 | S. Wrede | h2. Installation of RSB-XML |
120 | 4 | S. Wrede | |
121 | 4 | S. Wrede | * for rsb-xml, you need to additionally install XOM (available via ubuntu) |
122 | 4 | S. Wrede | * and pass the following parameters to the ant build script |
123 | 4 | S. Wrede | |
124 | 5 | J. Moringen | |_.Ant Property |_.Meaning |_.Example | |
125 | 5 | J. Moringen | | @pbuf.lib@ | Location of Protobuf Library | @/usr/share/java/protobuf.jar@ | |
126 | 5 | J. Moringen | | @spread.daemon@ | Location of Spread Daemon Executable | @/vol/cit/sbin/spread@ | |
127 | 5 | J. Moringen | | @xom.lib@ | Location of XOM XML Library | @/usr/share/java/xom-1.2.1.jar@ | |
128 | 5 | J. Moringen | | @rsb.lib@ | Location of RSB Core Library | @/vol/cit/lib/java/RSBJava.jar@ | |