Changeset 20300 for greenstone3


Ignore:
Timestamp:
08/17/09 11:23:40 (12 years ago)
Author:
oranfry
Message:

copied the logic from linux-eqiv file (or near enough) to get gs3-setup working in absence of search4j

File:
1 edited

Legend:

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

    r20243 r20300  
    4848
    4949:: ---- Search for java ----
    50 bin\search4j.exe -p "%CD%\packages\jre" -m %java_min_version% | winutil\setvar.exe _JRE_HOME > %TMP%\set_jre_home.bat
    51 call %TMP%\set_jre_home.bat
    52 del %TMP%\set_jre_home.bat
     50set JAVA_MIN_VERSION=1.5.0_00
     51set HINT=%CD%\packages\jre
     52::if search4j is present, use it
     53set FOUNDJAVAHOME=
     54set RUNJAVA=
     55if exist bin\search4j.exe (
     56  for /F "tokens=*" %%r in ('bin\search4j.exe -p "%HINT%" -m %JAVA_MIN_VERSION%') do set FOUNDJAVAHOME=%%r
     57)
    5358
    54 echo %_JRE_HOME%\bin\java.exe | winutil\setvar.exe RUNJAVA > %TMP%\setrunjava.bat
    55 call %TMP%\setrunjava.bat
    56 del %TMP%\setrunjava.bat
     59if not "%FOUNDJAVAHOME%"=="" (
     60  set JAVA_HOME=%FOUNDJAVAHOME%
     61  set PATH=%FOUNDJAVAHOME%\bin;%PATH%
     62  set RUNJAVA=%FOUNDJAVAHOME%\bin\java.exe
     63  goto summaryThenEnd
     64)
    5765
    58 if "%JRE_HOME%" == "" set JRE_HOME=%_JRE_HOME%
     66if exist "%HINT%\bin\java.exe" (
     67  set JAVA_HOME=%HINT%
     68  set PATH=%JAVA_HOME%\bin;%PATH%
     69  set RUNJAVA=%JAVA_HOME%\bin\java.exe
     70  goto summaryThenEnd
     71)
     72
     73if exist "%JAVA_HOME%\bin\java.exe" (
     74  set PATH=%JAVA_HOME%\bin;%PATH%
     75  set RUNJAVA=%JAVA_HOME%\bin\java.exe
     76  echo Using java at %JAVA_HOME%
     77  echo WARNING: Greenstone has not checked the version number of this java installation
     78  echo          The source distribution of Greenstone3 requires java 1.5 or greater
     79  echo          SVN users may still use java 1.4
     80  goto summaryThenEnd
     81)
     82
     83if exist "%JRE_HOME%\bin\java.exe" (
     84  set PATH=%JRE_HOME%\bin;%PATH%
     85  set RUNJAVA=%JRE_HOME%\bin\java.exe
     86  echo Using java at %JRE_HOME%
     87  echo WARNING: Greenstone has not checked the version number of this java installation
     88  echo          The source distribution of Greenstone3 requires java 1.5 or greater
     89  echo          SVN users may still use java 1.4
     90  goto summaryThenEnd
     91)
     92
     93echo ERROR: Failed to locate java
     94echo        Please set JAVA_HOME or JRE_HOME to point to an appropriate java
     95goto end
     96
     97:summaryThenEnd
    5998
    6099echo GSDL3SRCHOME : %GSDL3SRCHOME%
    61100echo GSDL3HOME    : %GSDL3HOME%
    62101echo JAVA         : %RUNJAVA%
     102
     103:end
Note: See TracChangeset for help on using the changeset viewer.