Fix: Use env CLASSPATH when building log4j example
[lttng-ust.git] / doc / examples / java-log4j / run
CommitLineData
501f6777
CB
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
9DIR=`dirname $0`
10JARFILE="liblttng-ust-agent.jar"
2345c467
MJ
11
12# If system classpath is empty, try to guess log4j location
13if [ "x$CLASSPATH" = "x" ]; then
14 CLASSPATH="/usr/local/share/java/log4j.jar:/usr/share/java/log4j.jar"
15fi
501f6777
CB
16
17cd $DIR
18
19if [ -f "$DIR/.intree" ]; then
2345c467 20 CLASSPATH="../../../liblttng-ust-java-agent/java/$JARFILE:$CLASSPATH"
501f6777
CB
21 LIBPATH="../../../liblttng-ust-java-agent/jni/log4j/.libs"
22else
2345c467 23 CLASSPATH="/usr/local/share/java/$JARFILE:/usr/share/java/$JARFILE:$CLASSPATH"
5c0f2ea7
MJ
24 # Use system defined java.library.path
25 #LIBPATH="/usr/local/lib:/usr/lib"
501f6777
CB
26fi
27
5c0f2ea7 28java -classpath "$CLASSPATH:." -Djava.library.path="$LIBPATH" Hello
501f6777
CB
29
30cd -
This page took 0.024187 seconds and 4 git commands to generate.