aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/bootstrap/compile.sh
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2015-06-23 17:15:12 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-06-24 12:08:13 +0000
commit338dc56eae94efcaaf67850dcf9424314ea5b72e (patch)
treeac67f547946518562a4e867c2a90d899ffc7be77 /scripts/bootstrap/compile.sh
parent9290ac6c8dac3a36a73278cb3d179704f7663782 (diff)
Disable tests that requires JDK 8 when using compile.sh
Also fix the OS X travis build file. -- MOS_MIGRATED_REVID=96683399
Diffstat (limited to 'scripts/bootstrap/compile.sh')
-rwxr-xr-xscripts/bootstrap/compile.sh18
1 files changed, 3 insertions, 15 deletions
diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh
index 5ac4efe208..9161905001 100755
--- a/scripts/bootstrap/compile.sh
+++ b/scripts/bootstrap/compile.sh
@@ -134,22 +134,10 @@ esac
[[ -x "${PROTOC-}" ]] \
|| fail "Protobuf compiler not found in ${PROTOC-}"
-test -z "$JAVA_HOME" && fail "JDK not found, please set \$JAVA_HOME."
-
-JAVAC="${JAVA_HOME}/bin/javac"
-
-[[ -x "${JAVAC}" ]] \
- || fail "JAVA_HOME ($JAVA_HOME) is not a path to a working JDK."
-
# Check that javac -version returns a upper version than $JAVA_VERSION.
-JAVAC_VERSION=$("${JAVAC}" -version 2>&1)
-if [[ "$JAVAC_VERSION" =~ ^"javac "(1\.([789]|[1-9][0-9])).*$ ]]; then
- JAVAC_VERSION=${BASH_REMATCH[1]}
- [ ${JAVA_VERSION#*.} -le ${JAVAC_VERSION#*.} ] || \
- fail "JDK version (${JAVAC_VERSION}) is lower than ${JAVA_VERSION}, please set \$JAVA_HOME."
-else
- fail "Cannot determine JDK version, please set \$JAVA_HOME."
-fi
+get_java_version
+[ ${JAVA_VERSION#*.} -le ${JAVAC_VERSION#*.} ] || \
+ fail "JDK version (${JAVAC_VERSION}) is lower than ${JAVA_VERSION}, please set \$JAVA_HOME."
JAR="${JAVA_HOME}/bin/jar"