Show
Ignore:
Timestamp:
06.03.2017 17:08:44 (3 years ago)
Author:
ak19
Message:

Corrections to commit of revision 31447, to handle further cases: even if the JAVA_HOME/JRE_HOME found by search4j were not of the correct bitness for the GS3 installation, if there's no bundled JRE, then shouldn't just check for a system JAVA_HOME or JRE_HOME but use the one found by search4j (and proceed to warn about the incompatibility, as before).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/gs3-setup.bat

    r31460 r31461  
    196196    if !ERRORLEVEL! equ 1 echo *** The detected system JDK java is an incompatible bit architecture& goto testjre    
    197197    if !ERRORLEVEL! equ 0 ( 
    198         echo *** The detected system JDK java is a matching %bitness% bit 
    199         echo *** Using the system JAVA_HOME detected 
    200         set JAVA_HOME=!FOUNDJAVAHOME! 
    201         set PATH=!FOUNDJAVAHOME!\bin;!PATH! 
    202         set RUNJAVA=!FOUNDJAVAHOME!\bin\java.exe 
    203         goto summaryThenEnd 
     198        echo *** The detected system JDK java is a matching %bitness% bit        
     199        goto setupjavahome 
    204200    )    
    205201) 
     
    213209        rem The JRE_HOME found by search4j may be the bundled JRE, overriding any system JRE_HOME, 
    214210        rem because the bundled JRE_HOME was provided as HINT to search4j.       
    215         echo *** The detected JRE java is a matching %bitness% bit 
    216         echo *** Using the JRE_HOME detected 
    217         set JRE_HOME=!FOUNDJREHOME! 
    218         set PATH=!FOUNDJREHOME!\bin;!PATH! 
    219         set RUNJAVA=!FOUNDJREHOME!\bin\java.exe 
    220         goto summaryThenEnd 
     211        echo *** The detected JRE java is a matching %bitness% bit           
     212        goto setupjrehome 
    221213    )    
    222214) 
     
    228220if exist "!HINT!\bin\java.exe" ( 
    229221  echo *** Changing to use the GS bundled 32-bit jre. 
    230   set JAVA_HOME=!HINT! 
     222  set JRE_HOME=!HINT! 
    231223  set PATH=!JAVA_HOME!\bin;!PATH! 
    232224  set RUNJAVA=!JAVA_HOME!\bin\java.exe 
     
    234226) 
    235227 
    236 :: 4. Last ditch effort: search4j couldn't find any java, but check any Java env vars set anyway 
     228:: 4. If no bundled JRE exists either, we'd still need to check if search4j found a JAVA_HOME or JRE_HOME 
     229:: and use that even if there was a bitness mismatch btw GS3 and the Java found. 
     230:: Label summaryThenEnd will print out warnings on any mismatch 
     231:setupjavahome 
     232if DEFINED FOUNDJAVAHOME  ( 
     233    echo *** Using the system JAVA_HOME detected at !FOUNDJAVAHOME! 
     234    set JAVA_HOME=!FOUNDJAVAHOME! 
     235    set PATH=!FOUNDJAVAHOME!\bin;!PATH! 
     236    set RUNJAVA=!FOUNDJAVAHOME!\bin\java.exe 
     237    goto summaryThenEnd 
     238) 
     239 
     240:setupjrehome 
     241if DEFINED FOUNDJREHOME ( 
     242    echo *** Using the JRE_HOME detected at !FOUNDJREHOME! 
     243    set JRE_HOME=!FOUNDJREHOME! 
     244    set PATH=!FOUNDJREHOME!\bin;!PATH! 
     245    set RUNJAVA=!FOUNDJREHOME!\bin\java.exe 
     246    goto summaryThenEnd 
     247) 
     248 
     249:: 5. Last ditch effort: search4j couldn't find any java, but check any Java env vars set anyway 
    237250echo *** Search4j could not find an appropriate JAVA or JRE. 
    238251echo *** Attempting to use any JAVA_HOME else JRE_HOME in the environment... 
     
    265278 
    266279:summaryThenEnd 
    267 :: Check that the bitness of any Java found is appropriate and warn if it is not. 
     280:: 6. Check that the bitness of any Java found is appropriate and warn if it is not. 
    268281"!RUNJAVA!" -d%bitness% -version 2> nul 
    269282if !ERRORLEVEL! equ 1 ( 
    270     echo *** WARNING: Detected mismatch between the bit-ness of your Greenstone installation ^(%bitness% bit^) and the Java found. 
     283    echo *** WARNING: Detected mismatch between the bit-ness of your Greenstone installation ^(%bitness% bit^) 
     284    echo *** and the Java found at %RUNJAVA%. 
    271285    echo *** Continuing with this Java anyway: 
    272286    echo *** This will only affect MG/MGPP collections for searching, and GDBM database collections