Index: build/install-build-deps-android.sh |
diff --git a/build/install-build-deps-android.sh b/build/install-build-deps-android.sh |
index 9f1317ef3b8b667e81f0cf568ad32228ff4ea78b..172279b2ecc4bb457517874b137a8999acfb0f2a 100755 |
--- a/build/install-build-deps-android.sh |
+++ b/build/install-build-deps-android.sh |
@@ -19,12 +19,23 @@ if ! uname -m | egrep -q "i686|x86_64"; then |
exit |
fi |
+lsb_release=$(lsb_release --codename --short) |
+ |
+case $lsb_release in |
+ xenial) |
+ java_alternative="java-1.8.0-openjdk-amd64" |
+ java_pkgs="openjdk-8-jre openjdk-8-jdk" |
+ ;; |
+ *) |
+ java_alternative="java-1.7.0-openjdk-amd64" |
+ java_pkgs="openjdk-7-jre openjdk-7-jdk" |
+ ;; |
+esac |
+ |
# Install first the default Linux build deps. |
"$(dirname "${BASH_SOURCE[0]}")/install-build-deps.sh" \ |
--no-syms --lib32 --no-arm --no-chromeos-fonts --no-nacl --no-prompt "${args}" |
-lsb_release=$(lsb_release --codename --short) |
- |
# The temporary directory used to store output of update-java-alternatives |
TEMPDIR=$(mktemp -d) |
cleanup() { |
@@ -56,15 +67,15 @@ fi |
sudo apt-get -y install ant |
-# Install openjdk and openjre 7 stuff |
-sudo apt-get -y install openjdk-7-jre openjdk-7-jdk |
+# Install openjdk and openjre stuff |
+sudo apt-get -y install $java_pkgs |
# Switch version of Java to openjdk 7. |
# Some Java plugins (e.g. for firefox, mozilla) are not required to build, and |
# thus are treated only as warnings. Any errors in updating java alternatives |
# which are not '*-javaplugin.so' will cause errors and stop the script from |
# completing successfully. |
-if ! sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 \ |
+if ! sudo update-java-alternatives -s $java_alternative \ |
>& "${TEMPDIR}"/update-java-alternatives.out |
then |
# Check that there are the expected javaplugin.so errors for the update |