Fix: running java examples out of tree
[lttng-ust.git] / doc / examples / java-jul / run
1 #!/bin/bash
2
3 #
4 # The -cp path should be changed to the lttng ust JUL jar file on your system
5 # or locally to the project. Same goes for the Java library path in order to
6 # find the JNI JUL library.
7 #
8
9 DIR=`dirname $0`
10 JARFILE="liblttng-ust-agent.jar"
11 JAVA_OPTIONS=""
12
13 cd $DIR
14
15 if [ -f "$DIR/.intree" ]; then
16 CLASSPATH="../../../liblttng-ust-java-agent/java/$JARFILE"
17 LIBPATH="../../../liblttng-ust-java-agent/jni/jul/.libs"
18 else
19 CLASSPATH="/usr/local/share/java/$JARFILE:/usr/share/java/$JARFILE"
20 # Use system defined java.library.path
21 #LIBPATH="/usr/local/lib:/usr/lib"
22 fi
23
24 if [ "x$LIBPATH" != "x" ]; then
25 JAVA_OPTIONS="$JAVA_OPTIONS -Djava.library.path=\"$LIBPATH\""
26 fi
27
28 java -classpath "$CLASSPATH:." $JAVA_OPTIONS Hello
29
30 cd -
This page took 0.029631 seconds and 4 git commands to generate.