forked from openkylin/platform_build
Use sensible default locations for Java
Use sensible default locations for Java based on the EXPERIMENTAL_USE_JAVA8 flag. Bug: 25786468 Change-Id: I7ec035b5329785efc41b3f971d5e3ae202293576
This commit is contained in:
parent
edfa0981c9
commit
91e012cd99
33
envsetup.sh
33
envsetup.sh
|
@ -1407,11 +1407,7 @@ function godir () {
|
||||||
\cd $T/$pathname
|
\cd $T/$pathname
|
||||||
}
|
}
|
||||||
|
|
||||||
# Force JAVA_HOME to point to java 1.7 if it isn't already set.
|
# Force JAVA_HOME to point to java 1.7/1.8 if it isn't already set.
|
||||||
#
|
|
||||||
# Note that the MacOS path for java 1.7 includes a minor revision number (sigh).
|
|
||||||
# For some reason, installing the JDK doesn't make it show up in the
|
|
||||||
# JavaVM.framework/Versions/1.7/ folder.
|
|
||||||
function set_java_home() {
|
function set_java_home() {
|
||||||
# Clear the existing JAVA_HOME value if we set it ourselves, so that
|
# Clear the existing JAVA_HOME value if we set it ourselves, so that
|
||||||
# we can reset it later, depending on the version of java the build
|
# we can reset it later, depending on the version of java the build
|
||||||
|
@ -1424,14 +1420,25 @@ function set_java_home() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! "$JAVA_HOME" ]; then
|
if [ ! "$JAVA_HOME" ]; then
|
||||||
case `uname -s` in
|
if [ ! "$EXPERIMENTAL_USE_JAVA8" ]; then
|
||||||
Darwin)
|
case `uname -s` in
|
||||||
export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
|
Darwin)
|
||||||
;;
|
export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
|
||||||
*)
|
;;
|
||||||
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
|
*)
|
||||||
;;
|
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
|
||||||
esac
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
case `uname -s` in
|
||||||
|
Darwin)
|
||||||
|
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
# Keep track of the fact that we set JAVA_HOME ourselves, so that
|
# Keep track of the fact that we set JAVA_HOME ourselves, so that
|
||||||
# we can change it on the next envsetup.sh, if required.
|
# we can change it on the next envsetup.sh, if required.
|
||||||
|
|
Loading…
Reference in New Issue