Skip to contentSkip to conversation

Fix: running java examples out of tree

PATCH Mathieu Desnoyers 1 participant 1 message Jun 30, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mathieu Desnoyers

author Applied
#1 lore raw

merged into master and stable-2.6, thanks!

Mathieu

Quoted 55 lines · ----- On Jun 30, 2015, at 5:32 PM, Michael Jeanson [email protected] wrote:

---
doc/examples/java-jul/run | 7 ++++++-
doc/examples/java-log4j/run | 7 ++++++-

2 files changed, 12 insertions(+), 2 deletions(-)
doc/examples/java-jul/run +0 -0
index 37a3cfd..6deb6fd 100755
@@ -8,6 +8,7 @@
 

DIR=dirname $0
JARFILE="liblttng-ust-agent.jar"
+JAVA_OPTIONS=""

cd $DIR

doc/examples/java-jul/run +0 -0
@@ -20,6 +21,10 @@ else
 	#LIBPATH="/usr/local/lib:/usr/lib"

fi

doc/examples/java-jul/run +5 -1
-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 -

doc/examples/java-log4j/run +0 -0
index 9dca608..91f8f5d 100755
@@ -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

doc/examples/java-log4j/run +0 -0
@@ -25,6 +26,10 @@ else
 	#LIBPATH="/usr/local/lib:/usr/lib"

fi

doc/examples/java-log4j/run +5 -1
-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 -
--
1.9.1

Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com