From 94f4dfaaec2e7be9c2d10c0f67de78eb9897d342 Mon Sep 17 00:00:00 2001 From: Justin SB Date: Wed, 10 Sep 2014 18:39:55 -0700 Subject: [PATCH] Prompt to use yum to install JDK on yum machines Also recognize Debian/Ubuntu by apt-get --- .../cordova-scripts/ensure_android_bundle.sh | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/tools/cordova-scripts/ensure_android_bundle.sh b/tools/cordova-scripts/ensure_android_bundle.sh index c50b91a658..e2f7d7dc80 100755 --- a/tools/cordova-scripts/ensure_android_bundle.sh +++ b/tools/cordova-scripts/ensure_android_bundle.sh @@ -21,18 +21,28 @@ command -v java >/dev/null 2>&1 || { echo "Directions can be found at: http://openjdk.java.net/install/" echo "" - DISTRO=`lsb_release --id --short 2>/dev/null` || DISTRO="" + #DISTRO=`lsb_release --id --short 2>/dev/null` || DISTRO="" PROCESSOR=`uname --processor 2>/dev/null` || PROCESSOR="" + HAS_YUM=`yum --version 2>/dev/null` || HAS_YUM="" + HAS_APT_GET=`apt-get --help 2>/dev/null` || HAS_APT_GET="" - if [[ "${DISTRO}" == "Ubuntu" || "${DISTRO}" == "Debian" ]] ; then - echo "You can install the JDK using:" - echo " apt-get install openjdk-7-jdk" - if [[ "${PROCESSOR}" == "x86_64" ]] ; then - echo "" - echo "You will also the 32 bit libraries:" - echo " apt-get install lib32z1 lib32stdc++6" - fi + if [[ "${HAS_APT_GET}" != "" ]] ; then + echo "You can install the JDK using:" + echo " apt-get install openjdk-7-jdk" + + if [[ "${PROCESSOR}" == "x86_64" ]] ; then + echo "" + echo "You will also the 32 bit libraries:" + echo " apt-get install lib32z1 lib32stdc++6" + fi fi + + if [[ "${HAS_YUM}" != "" ]] ; then + echo "You can install the JDK using:" + echo " yum install -y java-1.7.0-openjdk" + fi + + else echo "The android platform needs a Java JDK to be installed on your system." # This effectively does this...