Changeset 30106


Ignore:
Timestamp:
2015-08-13T20:33:28+12:00 (6 years ago)
Author:
ak19
Message:

HINT for search4j adjusted after JRE inclusion on Mac Lion.

Location:
main/trunk
Files:
3 edited

Legend:

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

    r29010 r30106  
    6767
    6868    # Give search4j a hint to find Java depending on the platform
    69     if [ "$GSDLOS" = "linux" ]; then
    70     HINT=`cd "$GSDLHOME";pwd`/packages/jre
    71     elif [ "$GSDLOS" = "darwin" ]; then
    72     # http://java.dzone.com/articles/java-findingsetting
     69    # we now include a JRE with Mac (Mountain) Lion, because from Yosemite onwards there's no system Java on Macs
     70    HINT=`cd "$GSDLHOME";pwd`/packages/jre   
     71   
     72    # we can't use boolean operator -a to do the AND, since it doesn't "short-circuit" if the first test fails
     73    # see http://www.tldp.org/LDP/abs/html/comparison-ops.html
     74    if [ "$GSDLOS" = "darwin" ] && [ ! -d "$HINT" ]; then
     75        # http://java.dzone.com/articles/java-findingsetting
    7376    # explains that /usr/libexec/java_home will print the default JDK
    7477    # regardless of which Mac OS we're on. Tested on Maverick, Lion, Leopard
    7578    # (run `/usr/libexec/java_home -v 1.7` to find a specific version)
    7679    HINT=`/usr/libexec/java_home`
    77     fi 
     80    fi
    7881   
    7982    javapath="`"$SEARCH4J_EXECUTABLE" -e -p "$HINT" -m $MINIMUM_JAVA_VERSION`"
  • main/trunk/greenstone3/gs3-server.sh

    r27873 r30106  
    104104# JRE_HOME or JAVA_HOME must be set correctly to run this program
    105105HINT="`pwd`/packages/jre"
     106if [ "$GSDLOS" = "darwin" ] && [ ! -d "$HINT" ]; then
     107    HINT=`/usr/libexec/java_home`
     108fi
    106109javapath=`search4j -p "$HINT" -m $java_min_version -e`
    107110if [ "$?" == "0" ]; then
  • main/trunk/greenstone3/gs3-setup.sh

    r26795 r30106  
    179179function checkJava() {
    180180
     181  # we now include a JRE with Mac (Mountain) Lion too, because from Yosemite onwards there's no system Java on Macs
    181182  HINT="`pwd`/packages/jre"
    182   if [ $GSDLOS = darwin ]; then
    183         HINT=/System/Library/Frameworks/JavaVM.framework/Home
     183  if [ "$GSDLOS" = "darwin" ] && [ ! -d "$HINT" ]; then
     184      HINT=`/usr/libexec/java_home`
     185      # old code used as fallback:
     186      if [ ! -d "$HINT" ]; then
     187          HINT=/System/Library/Frameworks/JavaVM.framework/Home
     188      fi
    184189  fi
    185190
     
    188193    FOUNDJAVAHOME="`bin/search4j -p \"$HINT\" -m $java_min_version`"
    189194    if [ "$?" == "0" ]; then
    190       #found a suitible java
     195      #found a suitable java
    191196      setupJavaAt "$FOUNDJAVAHOME"
    192197    else
Note: See TracChangeset for help on using the changeset viewer.