turbostat: Fix parsing warnings
[collectd.git] / docs / BUILD.java.md
1 # Building with Java
2
3 This file gives some background and hints how the *java plugin* needs to be
4 configured.
5
6 ## Dependencies
7
8 The *java plugin* requires a version of Java with *Java Native Interface* (JNI)
9 **1.2** or later.
10
11 ## Configure and flags
12
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.
17
18 The easiest way to use the `--with-java="${JAVA_HOME}"` option, where
19 `JAVA_HOME` is usually something like:
20
21     /usr/lib/jvm/java-1.5.0-sun-1.5.0.14
22
23 The configure script will then use *find(1)* to look for the following files:
24
25  *  `jni.h`
26  *  `jni_md.h`
27  *  `libjvm.so`
28
29 If found, appropriate CPP-flags and LD-flags are set and the following library
30 checks succeed.
31
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:
35
36  *  `JAVA_CPPFLAGS`
37  *  `JAVA_CFLAGS`
38  *  `JAVA_LDFLAGS`
39  *  `JAVA_LIBS`
40
41 For example (shortened for demonstration purposes):
42
43     ./configure JAVA_CPPFLAGS="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
44
45 Adding `-ljvm` to JAVA_LIBS is done automatically, you don't have to do that.
46
47 ## License
48
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`.