Make Java 8 the default JDK for Xenial
@@ -15,12 +15,17 @@ if [ -z "${APPSCALE_PACKAGE_MIRROR-}" ]; then
export APPSCALE_PACKAGE_MIRROR=http://s3.amazonaws.com/appscale-build
fi
+JAVA_VERSION="java-8-openjdk"
+case "${DIST}" in
+ precise|trusty|wheezy) JAVA_VERSION="java-7-openjdk" ;;
+esac
+
export UNAME_MACHINE=$(uname -m)
if [ -z "${JAVA_HOME_DIRECTORY-}" ]; then
if [ "$UNAME_MACHINE" = "x86_64" ]; then
- export JAVA_HOME_DIRECTORY=/usr/lib/jvm/java-7-openjdk-amd64
+ export JAVA_HOME_DIRECTORY=/usr/lib/jvm/${JAVA_VERSION}-amd64
elif [ "$UNAME_MACHINE" = "armv7l" ] || [ "$UNAME_MACHINE" = "armv6l" ]; then
- export JAVA_HOME_DIRECTORY=/usr/lib/jvm/java-7-openjdk-armhf
+ export JAVA_HOME_DIRECTORY=/usr/lib/jvm/${JAVA_VERSION}-armhf
fi
fi
@@ -226,7 +231,7 @@ EOF
installjavajdk()
{
- # This makes jdk-7 the default JVM.
+ # This sets the default JVM.
update-alternatives --set java ${JAVA_HOME_DIRECTORY}/jre/bin/java
}
