diff options
author | stepancheg <stepancheg@epfl.ch> | 2008-06-14 12:16:26 +0000 |
---|---|---|
committer | stepancheg <stepancheg@epfl.ch> | 2008-06-14 12:16:26 +0000 |
commit | 70ead2ee53c24d199a9156637b3dd5f44e00298f (patch) | |
tree | 81eb970e19369bedf887ed296184e625da27a28a /src | |
parent | aa2a5f89d06b4e2db62b467660da044a87527652 (diff) | |
download | scala-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')
-rw-r--r-- | src/compiler/scala/tools/ant/templates/tool-unix.tmpl | 4 | ||||
-rw-r--r-- | src/compiler/scala/tools/ant/templates/tool-windows.tmpl | 7 | ||||
-rw-r--r-- | src/manual/scala/man1/fsc.scala | 4 | ||||
-rw-r--r-- | src/manual/scala/man1/scala.scala | 4 | ||||
-rw-r--r-- | src/manual/scala/man1/scalac.scala | 4 |
5 files changed, 23 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@ "$@@" diff --git a/src/compiler/scala/tools/ant/templates/tool-windows.tmpl b/src/compiler/scala/tools/ant/templates/tool-windows.tmpl index 914f8c8b26..8367d97f5b 100644 --- a/src/compiler/scala/tools/ant/templates/tool-windows.tmpl +++ b/src/compiler/scala/tools/ant/templates/tool-windows.tmpl @@ -26,6 +26,13 @@ if "%OS%"=="Windows_NT" ( rem We use the value of the JAVACMD environment variable if defined
set _JAVACMD=%JAVACMD%
+
+if "%_JAVACMD%" == "" (
+ if not %JAVA_HOME% == "" (
+ if exist %JAVA_HOME%\bin\java.exe set _JAVACMD="%JAVA_HOME%\bin\java.exe"
+ )
+)
+
if "%_JAVACMD%"=="" set _JAVACMD=java
rem We use the value of the JAVA_OPTS environment variable if defined
diff --git a/src/manual/scala/man1/fsc.scala b/src/manual/scala/man1/fsc.scala index 1b354494c2..cf339b9376 100644 --- a/src/manual/scala/man1/fsc.scala +++ b/src/manual/scala/man1/fsc.scala @@ -113,6 +113,10 @@ object fsc extends Command { "as part of the environment variable; spaces, quotation marks, " & "etc., will be passed directly to the shell for expansion."), Definition( + MBold("JAVA_HOME"), + "Specify JDK/JRE home directory. This directory is used to locate " & + "the " & MBold("java") & " command unless " & MBold("JAVACMD") & " variable set."), + Definition( MBold("JAVA_OPTS"), SeqPara( "Specify the options to be passed to the " & MBold("java") & diff --git a/src/manual/scala/man1/scala.scala b/src/manual/scala/man1/scala.scala index 3bcd751d66..3806faf11d 100644 --- a/src/manual/scala/man1/scala.scala +++ b/src/manual/scala/man1/scala.scala @@ -161,6 +161,10 @@ object scala extends Command { "as part of the environment variable; spaces, quotation marks, " & "etc., will be passed directly to the shell for expansion."), Definition( + MBold("JAVA_HOME"), + "Specify JDK/JRE home directory. This directory is used to locate " & + "the " & MBold("java") & " command unless " & MBold("JAVACMD") & " variable set."), + Definition( MBold("JAVA_OPTS"), SeqPara( "Specify the options to be passed to the " & MBold("java") & diff --git a/src/manual/scala/man1/scalac.scala b/src/manual/scala/man1/scalac.scala index 34d69d2ef4..068bfa2f8e 100644 --- a/src/manual/scala/man1/scalac.scala +++ b/src/manual/scala/man1/scalac.scala @@ -301,6 +301,10 @@ object scalac extends Command { "as part of the environment variable; spaces, quotation marks, " & "etc., will be passed directly to the shell for expansion."), Definition( + MBold("JAVA_HOME"), + "Specify JDK/JRE home directory. This directory is used to locate " & + "the " & MBold("java") & " command unless " & MBold("JAVACMD") & " variable set."), + Definition( MBold("JAVA_OPTS"), SeqPara( "Specify the options to be passed to the " & MBold("java") & |