Switch the required host Java environment to 1.6.
The path to the Java toolchain is now explicitly
specified so no manual configuration should be
required.
Change-Id: I84abc122c557372e77e4579e9a9efe56af2b412c
diff --git a/envsetup.sh b/envsetup.sh
index c899c5c..7005ef6 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -99,6 +99,9 @@
if [ -n $ANDROID_BUILD_PATHS ] ; then
export PATH=${PATH/$ANDROID_BUILD_PATHS/}
fi
+ if [ -n $ANDROID_PRE_BUILD_PATHS ] ; then
+ export PATH=${PATH/$ANDROID_PRE_BUILD_PATHS/}
+ fi
# and in with the new
CODE_REVIEWS=
@@ -109,6 +112,15 @@
export ANDROID_BUILD_PATHS=:$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ANDROID_EABI_TOOLCHAIN$CODE_REVIEWS
export PATH=$PATH$ANDROID_BUILD_PATHS
+ unset ANDROID_JAVA_TOOLCHAIN
+ if [ -n "$JAVA_HOME" ]; then
+ export ANDROID_JAVA_TOOLCHAIN=$JAVA_HOME/bin
+ fi
+ export ANDROID_PRE_BUILD_PATHS=$ANDROID_JAVA_TOOLCHAIN
+ if [ -n "$ANDROID_PRE_BUILD_PATHS" ]; then
+ export PATH=$ANDROID_PRE_BUILD_PATHS:$PATH
+ fi
+
unset ANDROID_PRODUCT_OUT
export ANDROID_PRODUCT_OUT=$(get_abs_build_var PRODUCT_OUT)
export OUT=$ANDROID_PRODUCT_OUT
@@ -134,6 +146,7 @@
function set_stuff_for_environment()
{
settitle
+ set_java_home
setpaths
set_sequence_number
@@ -1053,19 +1066,21 @@
cd $T/$pathname
}
-# Force JAVA_HOME to point to java 1.5 if it isn't already set
-if [ "$STAY_OFF_MY_LAWN" = "" ]; then
- if [ ! "$JAVA_HOME" ]; then
- case `uname -s` in
- Darwin)
- export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home
- ;;
- *)
- export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
- ;;
- esac
+# Force JAVA_HOME to point to java 1.6 if it isn't already set
+function set_java_home() {
+ if [ "$STAY_OFF_MY_LAWN" = "" ]; then
+ if [ ! "$JAVA_HOME" ]; then
+ case `uname -s` in
+ Darwin)
+ export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
+ ;;
+ *)
+ export JAVA_HOME=/usr/lib/jvm/java-6-sun
+ ;;
+ esac
+ fi
fi
-fi
+}
# determine whether arrays are zero-based (bash) or one-based (zsh)
_xarray=(a b c)