Changeset 28829

Show
Ignore:
Timestamp:
04.02.2014 18:28:38 (6 years ago)
Author:
ak19
Message:

In the two Mac mavericks tested, java JDK was found in a different location. Furthermore, the JDK version numbers in the jdk installation folder need not be consistent. However, the means of finding out what javahome is, was consistent on Maverick. The java HINT that's set for search4j now goes through these steps to work out what the JAVAHOME hint out to be.

Files:
1 modified

Legend:

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

    r21317 r28829  
    6767 
    6868    # Give search4j a hint to find Java depending on the platform 
    69     if [ $GSDLOS = linux ]; then 
     69    if [ "$GSDLOS" = "linux" ]; then 
    7070    HINT=`cd "$GSDLHOME";pwd`/packages/jre 
    71     elif [ $GSDLOS = darwin ]; then 
    72     HINT=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home 
    73         #/System/Library/Frameworks/JavaVM.framework/Home 
     71    elif [ "$GSDLOS" = "darwin" ]; then 
     72    osversion=`uname -r | sed 's/\..*$//'`;  
     73    # mac maverick is version 13 
     74    if [ $osversion -ge 13 ] ; then  
     75        # To work out java: 
     76        # 1. run "which java", which for example prints /usr/bin/java 
     77        # 2a. then do "ls -la" on that. The result is for example 
     78        # lrwxr-xr-x  1 root  wheel  74 20 Jan 15:08 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java 
     79        # 2b. remove everything before the symlink portion (before the "-> "), to get 
     80        # /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java 
     81        # 3. then suffix "_home" to it, to get 
     82        # /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home 
     83        # 4. Then run this executable, which will tell you JAVA_HOME, e.g. 
     84        # /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home 
     85 
     86        whichjava=`which java`; 
     87        symlink=`ls -la $whichjava | sed 's/[^>]*> //'` 
     88        javahome=$symlink"_home" 
     89        HINT=`$javahome`         
     90    else 
     91        HINT=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home 
     92        #/System/Library/Frameworks/JavaVM.framework/Home 
     93    fi 
     94 
    7495    fi   
    7596