summaryrefslogtreecommitdiff
path: root/demoscript/Util.py
diff options
context:
space:
mode:
Diffstat (limited to 'demoscript/Util.py')
-rw-r--r--demoscript/Util.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/demoscript/Util.py b/demoscript/Util.py
index af74d024a35..970283e717b 100644
--- a/demoscript/Util.py
+++ b/demoscript/Util.py
@@ -16,6 +16,9 @@ import signal
import time
import subprocess
+javaHome = os.environ.get("JAVA_HOME", "")
+javaCmd = os.path.join('"%s"' % javaHome, "bin", "java") if javaHome else "java"
+
# Locate the top level directory of the demo dist (or the top of the
# source tree for a source dist).
path = [ ".", "..", "../..", "../../..", "../../../.." ]
@@ -610,6 +613,8 @@ def spawn(command, cwd = None, mapping = None):
command = command.replace("java", "java -Djava.net.preferIPv4Stack=true", 1)
if isSolaris() and x64:
command = command.replace("java", "java -d64", 1)
+ if javaCmd != "java":
+ command = command.replace("java", javaCmd, 1)
elif mapping == "cpp":
if cwd != None:
desc = os.path.join(cwd, desc)