Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/19312#discussion_r140410448
--- Diff: dev/create-release/release-build.sh ---
@@ -95,6 +95,28 @@ if [ -z "$SPARK_VERSION" ]; then
| grep -v INFO | grep -v WARNING | grep -v Download)
fi
+# Verify we have the right java version set
+java_version=$("${JAVA_HOME}"/bin/javac -version 2>&1 | cut -d " " -f 2)
--- End diff --
@holdenk, should we maybe catch the case when `JAVA_HOME` is missing too?
If so, I think we could do something like ...
```bash
if [ -z "$JAVA_HOME" ]; then
echo "Please set JAVA_HOME."
exit 1
fi
...
```
Or maybe...
```bash
if [[ -x "$JAVA_HOME/bin/javac" ]]; then
javac_cmd="$JAVA_HOME/bin/javac"
else
javac_cmd=javac
fi
java_version=$("$javac_cmd" -version 2>&1 | cut -d " " -f 2)
...
```
I tested both in my local.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]