Fix: running java examples out of tree
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 30 Jun 2015 21:32:56 +0000 (17:32 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 30 Jun 2015 22:29:06 +0000 (18:29 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
doc/examples/java-jul/run
doc/examples/java-log4j/run

index 37a3cfdf043b0a5df58a0df280434433a9a10c7a..6deb6fd8ca04741de67cdfc3997bf12b6aeed094 100755 (executable)
@@ -8,6 +8,7 @@
 
 DIR=`dirname $0`
 JARFILE="liblttng-ust-agent.jar"
+JAVA_OPTIONS=""
 
 cd $DIR
 
@@ -20,6 +21,10 @@ else
        #LIBPATH="/usr/local/lib:/usr/lib"
 fi
 
-java -classpath "$CLASSPATH:." -Djava.library.path="$LIBPATH" Hello
+if [ "x$LIBPATH" != "x" ]; then
+       JAVA_OPTIONS="$JAVA_OPTIONS -Djava.library.path=\"$LIBPATH\""
+fi
+
+java -classpath "$CLASSPATH:." $JAVA_OPTIONS Hello
 
 cd -
index 9dca6087690d15bff9bd6b149a2f978762d726e0..91f8f5d6b74300996b999f216e31fb2f2c935077 100755 (executable)
@@ -8,6 +8,7 @@
 
 DIR=`dirname $0`
 JARFILE="liblttng-ust-agent.jar"
+JAVA_OPTIONS=""
 
 # If system classpath is empty, try to guess log4j location
 if [ "x$CLASSPATH" = "x" ]; then
@@ -25,6 +26,10 @@ else
        #LIBPATH="/usr/local/lib:/usr/lib"
 fi
 
-java -classpath "$CLASSPATH:." -Djava.library.path="$LIBPATH" Hello
+if [ "x$LIBPATH" != "x" ]; then
+       JAVA_OPTIONS="$JAVA_OPTIONS -Djava.library.path=\"$LIBPATH\""
+fi
+
+java -classpath "$CLASSPATH:." $JAVA_OPTIONS Hello
 
 cd -
This page took 0.026129 seconds and 4 git commands to generate.