From df2f0669465082a17f3f8800b227d007f6e88cb0 Mon Sep 17 00:00:00 2001 From: Randall Wood Date: Mon, 7 Jun 2010 05:04:08 -0400 Subject: [PATCH] Allow narwhal to use the Java VM specified in the environment variable JAVA_HOME. This is done by prepending JAVA_HOME/bin to the PATH so that calls to the command 'java' use JAVA_HOME/bin/java instead the java in the system default location (usually /usr/bin/java). --- bin/narwhal | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/narwhal b/bin/narwhal index 75e0e033..2deabe9c 100755 --- a/bin/narwhal +++ b/bin/narwhal @@ -26,6 +26,11 @@ if [ -f "narwhal.local.conf" ]; then source "narwhal.local.conf" fi +# if JAVA_HOME is set, prepend JAVA_HOME/bin to PATH so correct JVM is used +if [ -d "$JAVA_HOME" ]; then + export PATH=$JAVA_HOME/bin:$PATH +fi + if [ -n "$NARWHAL_DEBUG" ]; then export NARWHAL_DEBUG fi