From: mjeanson@efficios.com (Michael Jeanson)
Subject: [lttng-dev] [PATCH lttng-ust] Fix: running java examples out of tree
Date: Tue, 30 Jun 2015 17:32:56 -0400 [thread overview]
Message-ID: <1435699976-8809-1-git-send-email-mjeanson@efficios.com> (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
next reply other threads:[~2015-06-30 21:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-30 21:32 Michael Jeanson [this message]
2015-06-30 22:29 ` Mathieu Desnoyers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1435699976-8809-1-git-send-email-mjeanson@efficios.com \
--to=mjeanson@efficios.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox