Code

src/Makefile.am: Fix dependencies for the "tail" and "match" utilities.
[collectd.git] / docs / BUILD.java.md
1 # Building with Java
3 This file gives some background and hints how the *java plugin* needs to be
4 configured.
6 ## Dependencies
8 The *java plugin* requires a version of Java with *Java Native Interface* (JNI)
9 **1.2** or later.
11 ## Configure and flags
13 To determine the location of the required files of a Java installation is not an
14 easy task, because the locations vary with your kernel (Linux, SunOS, …) and
15 with your architecture (x86, SPARC, …) and there is no `java-config` script we
16 could use. Configuration of the JVM library is therefore a bit tricky.
18 The easiest way to use the `--with-java="${JAVA_HOME}"` option, where
19 `JAVA_HOME` is usually something like:
21     /usr/lib/jvm/java-1.5.0-sun-1.5.0.14
23 The configure script will then use *find(1)* to look for the following files:
25  *  `jni.h`
26  *  `jni_md.h`
27  *  `libjvm.so`
29 If found, appropriate CPP-flags and LD-flags are set and the following library
30 checks succeed.
32 If this doesn't work for you, you have the possibility to specify CPP-flags,
33 C-flags, LD-flags and LIBS for the *java plugin* by hand, using the following
34 environment variables:
36  *  `JAVA_CPPFLAGS`
37  *  `JAVA_CFLAGS`
38  *  `JAVA_LDFLAGS`
39  *  `JAVA_LIBS`
41 For example (shortened for demonstration purposes):
43     ./configure JAVA_CPPFLAGS="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
45 Adding `-ljvm` to JAVA_LIBS is done automatically, you don't have to do that.
47 ## License
49 The *java plugin* is licensed under the *GNU General Public License, version 2*.
50 Full licensing terms can be found in the file `COPYING`.