Changeset 33005


Ignore:
Timestamp:
2019-04-09T18:00:28+12:00 (5 years ago)
Author:
davidb
Message:

When testing on Peyman's Mac, findjava.sh was locating the system installed JDK over the custom JDK even though JAVA_HOME was set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/findjava.sh

    r32013 r33005  
    8080    # run silently in case no system java installed, as it will result in a confusing message about there being no java
    8181    # when we're still searching for java
    82     macHINT=`/usr/libexec/java_home 2>&1`
    83     #HINT=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
    84         #/System/Library/Frameworks/JavaVM.framework/Home
    85     status=$?
     82    if [ "x$JAVA_HOME" != "x" ]; then
     83      HINT="$JAVA_HOME"
     84    else
     85      #HINT=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
     86          #/System/Library/Frameworks/JavaVM.framework/Home
     87
     88      macHINT=`/usr/libexec/java_home 2>&1`
     89      status=$?
    8690        # if no java installed, then HINT will contain:
    8791        #  Unable to find any JVMs matching version "(null)".
    8892        #  No Java runtime present, try --request to install.
    8993        # and the status of running /usr/libexec/java_home will not be 0 but 1:
    90     if [ "$status" = "0" ]; then
    91         HINT=$macHINT
    92         else
    93         echo "No system Java on this mac..."
     94      if [ "$status" = "0" ]; then
     95          HINT=$macHINT
     96      else
     97          echo "No system Java on this mac..."
     98      fi
    9499    fi
    95100    fi
Note: See TracChangeset for help on using the changeset viewer.