diff options
author | cocoatomo <cocoatomo77@gmail.com> | 2014-10-14 15:09:51 -0700 |
---|---|---|
committer | Andrew Or <andrewor14@gmail.com> | 2014-10-14 15:09:51 -0700 |
commit | 7b4f39f647da1f7b1b57e38827a8639243c661cb (patch) | |
tree | 396e8b964e016c4123a4bda18387b8aac6f08b4d | |
parent | 56096dbaa8cb3ab39bfc2ce5827192313613b010 (diff) | |
download | spark-7b4f39f647da1f7b1b57e38827a8639243c661cb.tar.gz spark-7b4f39f647da1f7b1b57e38827a8639243c661cb.tar.bz2 spark-7b4f39f647da1f7b1b57e38827a8639243c661cb.zip |
[SPARK-3869] ./bin/spark-class miss Java version with _JAVA_OPTIONS set
When _JAVA_OPTIONS environment variable is set, a command "java -version" outputs a message like "Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8".
./bin/spark-class knows java version from the first line of "java -version" output, so it mistakes java version with _JAVA_OPTIONS set.
Author: cocoatomo <cocoatomo77@gmail.com>
Closes #2725 from cocoatomo/issues/3869-mistake-java-version and squashes the following commits:
f894ebd [cocoatomo] [SPARK-3869] ./bin/spark-class miss Java version with _JAVA_OPTIONS set
-rwxr-xr-x | bin/spark-class | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/spark-class b/bin/spark-class index e8201c18d5..91d858bc06 100755 --- a/bin/spark-class +++ b/bin/spark-class @@ -105,7 +105,7 @@ else exit 1 fi fi -JAVA_VERSION=$("$RUNNER" -version 2>&1 | sed 's/.* version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q') +JAVA_VERSION=$("$RUNNER" -version 2>&1 | grep 'version' | sed 's/.* version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q') # Set JAVA_OPTS to be able to load native libraries and to set heap size if [ "$JAVA_VERSION" -ge 18 ]; then |