Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f354bc8 authored by Neil Fuller's avatar Neil Fuller Committed by Gerrit Code Review
Browse files

Merge "Use sensible default locations for Java"

parents 4ed5735a 91e012cd
Loading
Loading
Loading
Loading
+20 −13
Original line number Diff line number Diff line
@@ -1413,11 +1413,7 @@ function godir () {
    \cd $T/$pathname
}

# Force JAVA_HOME to point to java 1.7 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.
# Force JAVA_HOME to point to java 1.7/1.8 if it isn't already set.
function set_java_home() {
    # 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
@@ -1430,6 +1426,7 @@ function set_java_home() {
    fi

    if [ ! "$JAVA_HOME" ]; then
      if [ ! "$EXPERIMENTAL_USE_JAVA8" ]; then
        case `uname -s` in
            Darwin)
                export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
@@ -1438,6 +1435,16 @@ function set_java_home() {
                export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
                ;;
        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
      # we can change it on the next envsetup.sh, if required.