Index: gli/trunk/gli.bat
===================================================================
--- gli/trunk/gli.bat	(revision 17493)
+++ gli/trunk/gli.bat	(revision 17501)
@@ -253,17 +253,42 @@
 
 :findJava
-winutil\search4j.exe -m "1.4.0_00" -p "%GSDLHOME%\packages\jre" | winutil\setvar.exe _JRE_HOME > %TMP%\set__jre_home.bat
-call "%TMP%\set__jre_home.bat"
-del "%TMP%\set__jre_home.bat"
-
-if "%_JRE_HOME%" == "" goto noJava
-echo %_JRE_HOME%\bin | winutil\setvar.exe JAVAPATH > %TMP%\set_javapath.bat
-call "%TMP%\set_javapath.bat"
-del "%TMP%\set_javapath.bat"
-echo JRE:
-echo %_JRE_HOME%
-echo.
-
-goto checkGLI
+    if "%_VERSION%" == "2" (
+		set SEARCH4J_EXECUTABLE=%GSDLHOME%\bin\windows\search4j.exe
+		set HINT=%GSDLHOME%\packages\jre
+	)
+    if "%_VERSION%" == "3" (
+		set SEARCH4J_EXECUTABLE=%GSDL3SRCHOME%\bin\search4j.exe
+		HINT=%GSDL3SRCHOME%\packages\jre
+	)
+    
+    "%SEARCH4J_EXECUTABLE%" -e -m "1.4.0_00" -p "%HINT%" | winutil\setvar.exe JAVA_EXECUTABLE > %TMP%\set_java_executable.bat
+    call "%TMP%\set_java_executable.bat"
+    del "%TMP%\set_java_executable.bat"
+    
+    if "%JAVA_EXECUTABLE%" == "" goto noJava
+    echo Java:
+    echo %JAVA_EXECUTABLE%
+    echo.
+
+    goto checkGLI
+
+:noJava
+    echo.
+    if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a
+    if "%GLILANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the
+    if "%GLILANG%" == "en" echo Greenstone Librarian Interface.
+
+    if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber 
+    if "%GLILANG%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.4 o superior)
+    if "%GLILANG%" == "es" echo antes de correr la Interfaz de la Biblioteca Digital Greenstone.
+
+    if "%GLILANG%" == "fr" echo Une version ad?quate de Java n'a pas pu ?tre localis?e. Vous devez
+    if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou sup?rieur)
+    if "%GLILANG%" == "fr" echo avant de d?marrer Greenstone Librarian Interface.
+
+    if "%GLILANG%" == "ru" echo ¥ ã «®áì ®¯à¥¥«âì ¬¥áâ®­ å®¥­¥ á®®â¢¥âáâ¢ãîé¥© ¢¥àá Java.
+    if "%GLILANG%" == "ru" echo ?ë ®«­ë ãáâ ­®¢âì Java Runtime Environment (¢¥àáî 1.4 « ¢ëè¥) ¯¥à¥ ¢¢®®¬
+    if "%GLILANG%" == "ru" echo ¡¡«®â¥ç­®£® ­â¥àä¥©á  Greenstone.
+    goto exit
 
 :checkGLI
@@ -326,5 +351,5 @@
 
 :: Run GS3 if version = 3
-if "%_VERSION%" == "3" "%JAVAPATH%\java" -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl %GSDLHOME% -gsdlos %GSDLOS% -gsdl3 %GSDL3HOME% -gsdl3src %GSDL3SRCHOME% -perl %PERLPATH% %1 %2 %3 %4 %5 %6 %7 %8 %9
+if "%_VERSION%" == "3" "%JAVA_EXECUTABLE%" -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl %GSDLHOME% -gsdlos %GSDLOS% -gsdl3 %GSDL3HOME% -gsdl3src %GSDL3SRCHOME% -perl %PERLPATH% %1 %2 %3 %4 %5 %6 %7 %8 %9
 if "%_VERSION%" == "3" goto finRun
 
@@ -336,5 +361,5 @@
 
 :webLib
-    "%JAVAPATH%\java" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl %GSDLHOME% -gsdlos %GSDLOS% -perl %PERLPATH% %1 %2 %3 %4 %5 %6 %7 %8 %9
+    "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl %GSDLHOME% -gsdlos %GSDLOS% -perl %PERLPATH% %1 %2 %3 %4 %5 %6 %7 %8 %9
     if ERRORLEVEL 2 if not "%localLibFailed%" == "true" (
         echo webLib failed, going to localLib
@@ -345,5 +370,5 @@
 
 :localLib
-    "%JAVAPATH%\java" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl %GSDLHOME% -gsdlos %GSDLOS% -perl %PERLPATH% -local_library %GSDLHOME%\server.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
+    "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl %GSDLHOME% -gsdlos %GSDLOS% -perl %PERLPATH% -local_library %GSDLHOME%\server.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
     if ERRORLEVEL 2 if not "%webLibFailed%" == "true" (
         echo localLib failed, going to webLib
@@ -369,3 +394,3 @@
 :: ---- Clean up ----
 set PERLPATH=
-set JAVAPATH=
+set JAVA_EXECUTABLE=
