9dca6087690d15bff9bd6b149a2f978762d726e0
[lttng-ust.git] / doc / examples / java-log4j / run
1 #!/bin/bash
2
3 #
4 # The -cp path should be changed to the lttng ust agent 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 Log4j library.
7 #
8
9 DIR=`dirname $0`
10 JARFILE="liblttng-ust-agent.jar"
11
12 # If system classpath is empty, try to guess log4j location
13 if [ "x$CLASSPATH" = "x" ]; then
14 CLASSPATH="/usr/local/share/java/log4j.jar:/usr/share/java/log4j.jar"
15 fi
16
17 cd $DIR
18
19 if [ -f "$DIR/.intree" ]; then
20 CLASSPATH="../../../liblttng-ust-java-agent/java/$JARFILE:$CLASSPATH"
21 LIBPATH="../../../liblttng-ust-java-agent/jni/log4j/.libs"
22 else
23 CLASSPATH="/usr/local/share/java/$JARFILE:/usr/share/java/$JARFILE:$CLASSPATH"
24 # Use system defined java.library.path
25 #LIBPATH="/usr/local/lib:/usr/lib"
26 fi
27
28 java -classpath "$CLASSPATH:." -Djava.library.path="$LIBPATH" Hello
29
30 cd -
This page took 0.029522 seconds and 3 git commands to generate.