summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
diff options
context:
space:
mode:
authorstepancheg <stepancheg@epfl.ch>2008-06-14 12:16:26 +0000
committerstepancheg <stepancheg@epfl.ch>2008-06-14 12:16:26 +0000
commit70ead2ee53c24d199a9156637b3dd5f44e00298f (patch)
tree81eb970e19369bedf887ed296184e625da27a28a /src/compiler/scala/tools/ant/templates/tool-unix.tmpl
parentaa2a5f89d06b4e2db62b467660da044a87527652 (diff)
downloadscala-70ead2ee53c24d199a9156637b3dd5f44e00298f.tar.gz
scala-70ead2ee53c24d199a9156637b3dd5f44e00298f.tar.bz2
scala-70ead2ee53c24d199a9156637b3dd5f44e00298f.zip
Scripts should use JAVA_HOME to find java execu...
Scripts should use JAVA_HOME to find java executable (#995)
Diffstat (limited to 'src/compiler/scala/tools/ant/templates/tool-unix.tmpl')
-rw-r--r--src/compiler/scala/tools/ant/templates/tool-unix.tmpl4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
index f75433bb64..47de171e88 100644
--- a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
+++ b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
@@ -58,4 +58,8 @@ fi
# Reminder: substitution ${JAVA_OPTS:=-Xmx256M -Xms16M} DO NOT work on Solaris
[ -n "$JAVA_OPTS" ] || JAVA_OPTS="@javaflags@"
+if [ -z "$JAVACMD" -a -n "$JAVA_HOME" -a -x "$JAVA_HOME/bin/java" ]; then
+ JAVACMD="$JAVA_HOME/bin/java"
+fi
+
exec ${JAVACMD:=java} $JAVA_OPTS -cp "$TOOL_CLASSPATH" -Dscala.home="$SCALA_HOME" -Denv.classpath="$CLASSPATH" -Denv.emacs="$EMACS" @properties@ @class@ @toolflags@ "$@@"