Changeset 32013 for main/trunk/gli

Show
Ignore:
Timestamp:
28.09.2017 23:10:13 (2 years ago)
Author:
ak19
Message:

Suppressing confusing message on Macs when there's no system Java installed but search4j is still trying to find a (custom) java and could potentially find one.

Files:
1 modified

Legend:

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

    r30128 r32013  
    7777    # regardless of which Mac OS we're on. Tested on Maverick, Lion, Leopard 
    7878    # (run `/usr/libexec/java_home -v 1.7` to find a specific version) 
    79     HINT=`/usr/libexec/java_home` 
     79 
     80    # run silently in case no system java installed, as it will result in a confusing message about there being no java 
     81    # 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=$? 
     86        # if no java installed, then HINT will contain: 
     87        #  Unable to find any JVMs matching version "(null)". 
     88        #  No Java runtime present, try --request to install. 
     89        # 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    fi 
    8095    fi 
    8196