* [lttng-dev] [PATCH lttng-ust] Fix: running java examples out of tree
@ 2015-06-30 21:32 Michael Jeanson
2015-06-30 22:29 ` Mathieu Desnoyers
0 siblings, 1 reply; 2+ messages in thread
From: Michael Jeanson @ 2015-06-30 21:32 UTC (permalink / raw)
---
doc/examples/java-jul/run | 7 ++++++-
doc/examples/java-log4j/run | 7 ++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/doc/examples/java-jul/run b/doc/examples/java-jul/run
index 37a3cfd..6deb6fd 100755
--- a/doc/examples/java-jul/run
+++ b/doc/examples/java-jul/run
@@ -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 -
diff --git a/doc/examples/java-log4j/run b/doc/examples/java-log4j/run
index 9dca608..91f8f5d 100755
--- a/doc/examples/java-log4j/run
+++ b/doc/examples/java-log4j/run
@@ -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 -
--
1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [lttng-dev] [PATCH lttng-ust] Fix: running java examples out of tree
2015-06-30 21:32 [lttng-dev] [PATCH lttng-ust] Fix: running java examples out of tree Michael Jeanson
@ 2015-06-30 22:29 ` Mathieu Desnoyers
0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Desnoyers @ 2015-06-30 22:29 UTC (permalink / raw)
merged into master and stable-2.6, thanks!
Mathieu
----- On Jun 30, 2015, at 5:32 PM, Michael Jeanson mjeanson at efficios.com wrote:
> ---
> doc/examples/java-jul/run | 7 ++++++-
> doc/examples/java-log4j/run | 7 ++++++-
> 2 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/doc/examples/java-jul/run b/doc/examples/java-jul/run
> index 37a3cfd..6deb6fd 100755
> --- a/doc/examples/java-jul/run
> +++ b/doc/examples/java-jul/run
> @@ -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 -
> diff --git a/doc/examples/java-log4j/run b/doc/examples/java-log4j/run
> index 9dca608..91f8f5d 100755
> --- a/doc/examples/java-log4j/run
> +++ b/doc/examples/java-log4j/run
> @@ -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 -
> --
> 1.9.1
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-30 22:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-30 21:32 [lttng-dev] [PATCH lttng-ust] Fix: running java examples out of tree Michael Jeanson
2015-06-30 22:29 ` Mathieu Desnoyers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox