Skip to content

Commit ad577d7

Browse files
committed
[SPARK-8558][BUILD] Script /dev/run-tests fails when _JAVA_OPTIONS env var set
1 parent 47c1d56 commit ad577d7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

dev/run-tests.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,15 @@ def determine_java_version(java_exe):
477477

478478
raw_output = subprocess.check_output([java_exe, "-version"],
479479
stderr=subprocess.STDOUT)
480-
raw_version_str = raw_output.split('\n')[0] # eg 'java version "1.8.0_25"'
480+
481+
raw_output_lines = raw_output.split('\n')
482+
483+
# find raw version string, eg 'java version "1.8.0_25"'. Skip _JAVA_OPTIONS line if present
484+
if raw_output_lines[0].startswith("Picked up _JAVA_OPTIONS"):
485+
raw_version_str = raw_output_lines[1]
486+
else:
487+
raw_version_str = raw_output_lines[0]
488+
481489
version_str = raw_version_str.split()[-1].strip('"') # eg '1.8.0_25'
482490
version, update = version_str.split('_') # eg ['1.8.0', '25']
483491

0 commit comments

Comments
 (0)