From 04be0d869acce82293b6c668f52bddf14c106908 Mon Sep 17 00:00:00 2001 From: Jeff Hamilton Date: Mon, 7 Jun 2010 15:03:54 -0500 Subject: [PATCH] Set JAVA_HOME to point to java 1.5. Change-Id: I1304b78b17cd13a2231c59385a94e0430a8198ff --- envsetup.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/envsetup.sh b/envsetup.sh index 85465b1b2a..9c6e695360 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -1026,6 +1026,20 @@ function godir () { 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 + fi +fi + # determine whether arrays are zero-based (bash) or one-based (zsh) _xarray=(a b c) if [ -z "${_xarray[${#_xarray[@]}]}" ]