Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1056128: Enable JDK source level 1.7 for Android Java code. r=nal…
Browse files Browse the repository at this point in the history
…exander
  • Loading branch information
ChrisKitching committed Aug 29, 2014
1 parent c4cd809 commit 3ea28fc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/android-common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ ifndef JAVA_BOOTCLASSPATH
JAVA_BOOTCLASSPATH = $(ANDROID_SDK)/android.jar
endif

# For Android, we default to 1.5
# For Android, we default to 1.7
ifndef JAVA_VERSION
JAVA_VERSION = 1.5
JAVA_VERSION = 1.7
endif

JAVAC_FLAGS = \
Expand Down
18 changes: 18 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -5622,6 +5622,24 @@ if test -n "${JAVA_BIN_PATH}" -o \
if test -z "$KEYTOOL" -o "$KEYTOOL" = ":"; then
AC_MSG_ERROR([The program keytool was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}])
fi

AC_MSG_CHECKING([for minimum required javac version = 1.7])

dnl Javac spits out something like `javac 1.7.0`. This line cuts off the 'javac'
_javac_version=$($JAVAC -version 2>&1 | cut -d ' ' -f 2)

dnl Here, we extract the major (1) and minor (7) version numbers from the
dnl acquired version string.
_javac_major_version=$(echo $_javac_version | cut -d '.' -f 1)
_javac_minor_version=$(echo $_javac_version | cut -d '.' -f 2)

AC_MSG_RESULT([$_javac_version])

dnl Fail if we have a version other than 1.7.X
if test "$_javac_major_version" -ne "1" -o \
\( "$_javac_minor_version" -ne "7" \); then
AC_MSG_ERROR([javac 1.7 is required.])
fi
fi

dnl ========================================================
Expand Down

0 comments on commit 3ea28fc

Please sign in to comment.