Changeset 15138

Show
Ignore:
Timestamp:
27.03.2008 13:39:04 (11 years ago)
Author:
oranfry
Message:

if during gs3-setup no (appropriate) java is found except the bundled one, export JAVA_HOME to point to the bundled one

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/gs3-setup.sh

    r15134 r15138  
    77#   - java 
    88 
    9 java_min_version=1.4.0_00 
     9java_min_version=1.5.0_00 
    1010 
    1111 
     
    111111    which ant &> /dev/null 
    112112    if [ "$?" != "0" ]; then 
    113             ANT_HOME=$GSDLSRCHOME/packages/ant 
     113            ANT_HOME=$GSDL3SRCHOME/packages/ant 
    114114            PATH=$ANT_HOME/bin:$PATH 
    115115        echo "  - Setup ant" 
     
    123123function checkJava() { 
    124124    echo "Checking Java" 
    125   #check java 
     125 
    126126  bin/search4j -m $java_min_version &> /dev/null 
    127127  if [ "$?" != "0" ]; then 
    128     echo "  - Failed to locate java ($java_min_version or greater)" 
    129         bin/search4j &> /dev/null 
    130         if [ "$?" == "0" ]; then echo "  (It looks like you hava java but it's too old)"; fi 
    131         echo "  - Please set JAVA_HOME or JRE_HOME to point to an appropriate java" 
    132     echo "    And add JAVA_HOME/bin or JRE_HOME/bin to your PATH" 
     128 
     129        #java is not set up already 
     130      bin/search4j -m $java_min_version -h jre &> /dev/null 
     131      if [ "$?" == "0" ]; then 
     132            #bundled java exists, set up 
     133            export JAVA_HOME=`pwd`/jre 
     134        echo "  - Exported JAVA_HOME to point to bundled java" 
     135        else 
     136            #no java exists 
     137        echo "  - Failed to locate java ($java_min_version or greater)" 
     138            bin/search4j &> /dev/null; if [ "$?" == "0" ]; then echo "  (It looks like you hava java but it's too old)"; fi 
     139            echo "  - Please set JAVA_HOME or JRE_HOME to point to an appropriate java" 
     140        echo "    And add JAVA_HOME/bin or JRE_HOME/bin to your PATH" 
     141        fi 
     142 
    133143    else 
     144 
     145        #java is already set up 
    134146        echo "  - Found java at: `bin/search4j -m $java_min_version`" 
     147 
    135148  fi 
    136149    echo