Skip to content

Commit f3841be

Browse files
M #-: Improve java bindings documentation
1 parent 11505b5 commit f3841be

File tree

1 file changed

+33
-2
lines changed
  • source/integration_and_development/system_interfaces

1 file changed

+33
-2
lines changed

source/integration_and_development/system_interfaces/java.rst

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,45 @@ This page contains the OpenNebula Cloud API Specification for Java. It has been
99
Download
1010
================================================================================
1111

12-
You can download the ``.jar`` file compiled using Java 1.8, the required libraries, and the javadoc packaged in a tar.gz file `following this link <http://downloads.opennebula.io/packages>`__ in the OpenNebula version you have installed.
12+
You can download the ``.jar`` file compiled using Java 11, the required libraries, and the javadoc packaged in a tar.gz file `following this link <http://downloads.opennebula.io/packages>`__ in the OpenNebula version you have installed.
1313

1414
You can also consult the `javadoc online </doc/6.4/oca/java/>`__.
1515

16+
Compilation
17+
================================================================================
18+
19+
If you need to compile the Java bindings, please follow these steps
20+
21+
- Download the source code of opennebula (available on `OpenNebula code repository <https://www.github.com/OpenNebula/one>`__)
22+
23+
``git clone https://www.github.com/OpenNebula/one``
24+
25+
- On the source code, change to the directory ``src/oca/java``
26+
27+
``cd one/src/oca/java``
28+
29+
- Download the apache xmlrpc library (note that the URL may change in your case)
30+
31+
``curl -OL https://archive.apache.org/dist/ws/xmlrpc/binaries/xmlrpc-3.1.1-bin.tar.gz``
32+
33+
- Uncompress it and move the ``/lib`` directory to the source code dir
34+
35+
``tar xzvf xmlrpc-3.1.1-bin.tar.gz; mv xmlrpc-3.1.1/lib .``
36+
37+
- Modify the build script adding to the libraries the xmlrpc library
38+
39+
``sed -i 's@^LIB_DIR="/usr/share/java"$@LIB_DIR="/usr/share/java:./lib"@g' build.sh``
40+
41+
- Build the library
42+
43+
``build.sh``
44+
45+
The jar file with the bindings will be the ``jar/org.opennebula.client.jar`` file
46+
1647
Usage
1748
================================================================================
1849

19-
To use the OpenNebula Cloud API for Java in your Java project, you have to add to the classpath the org.opennebula.client.jar file and the XML-RPC libraries located in the lib directory.
50+
To use the OpenNebula Cloud API for Java in your Java project, you have to add to the classpath the ``org.opennebula.client.jar`` file and the XML-RPC libraries located in the lib directory.
2051

2152
Code Sample
2253
================================================================================

0 commit comments

Comments
 (0)