Changeset 14727 for greenstone3
- Timestamp:
- 2007-10-24T09:23:02+13:00 (17 years ago)
- Location:
- greenstone3/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
greenstone3/trunk/gs3-server.bat
r13931 r14727 1 1 @echo off 2 2 3 set SERVERLANG=en 3 echo Greenstone 3 Server 4 echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato 5 echo This software comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt 6 echo This is free software, and you are welcome to redistribute it 4 7 5 :: -------- Run the Greenstone 3 Server --------6 7 :: This script must be run from within the directory in which it lives8 if exist gs3-server.bat goto start9 if "%SERVERLANG%" == "en" echo This script must be run from the directory in which it resides.10 if "%SERVERLANG%" == "es" echo Este gui¢n deber ejecutarse desde el directorio en el que reside.11 if "%SERVERLANG%" == "fr" echo Ce script doit Ëtre exâcutâ ⊠partir du râpertoire dans lequel il se trouve.12 if "%SERVERLANG%" == "ru" echo Ââ®â áªà š¯â €®«Š¥ ¡ëâì ¢§ïâ š§ €šà ¥ªâ®à šš, ¢ ª®â®à ®© ® à  á¯®«®Š¥Â13 goto exit14 15 :start16 if "%OS%" == "Windows_NT" goto findGSDL17 :: Invoke a new command processor to ensure there's enough environment space18 if "%1" == "Second" goto findGSDL19 command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %920 goto done21 22 :findGSDL23 echo.24 if "%SERVERLANG%" == "en" echo Greenstone3 Server25 if "%SERVERLANG%" == "en" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato26 if "%SERVERLANG%" == "en" echo This program comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt27 if "%SERVERLANG%" == "en" echo This is free software, and you are welcome to redistribute it28 29 echo.30 8 :: ---- Determine GSDL3HOME ---- 9 :: Some users may set the above line manually 31 10 set GSDL3PATH= 32 11 33 :: Some users may set the above line manually34 if not "%GSDL3PATH%" == "" goto prepGSDL12 :: The default location is the current directory 13 if "%GSDL3PATH%" == "" set GSDL3PATH=. 35 14 36 :: The default location is the current directory 37 set GSDL3PATH=. 15 :: Setup Greenstone, unless it has already been done 16 if "%GSDL3SRCHOME%" == "" call "%GSDL3PATH%\gs3-setup.bat" SetEnv > nul 38 17 39 :: If it is set, use the GSDLHOME environment variable40 if "%GSDL3SRCHOME%" == "" goto prepGSDL41 set GSDL3PATH=%GSDL3SRCHOME%42 43 :prepGSDL44 :: Setup Greenstone, unless it has already been done45 if not "%GSDL3SRCHOME%" == "" goto doneGSDL46 call "%GSDL3PATH%\gs3-setup.bat" SetEnv > nul47 48 :doneGSDL49 :: GSDL3PATH is no longer needed, since GSDL3SRCHOME should now be set50 18 set GSDL3PATH= 51 19 52 :findJava 53 :: ---- Check Java exists ---- 54 set JAVAPATH= 20 "%RUNJAVA%" -cp "%CLASSPATH%" org.greenstone.server.Server "%GSDL3SRCHOME%" 55 21 56 :: Some users may set the above line manually57 if not "%JAVAPATH%" == "" goto testJava58 22 59 :: If it is set, use the JAVA_HOME environment variable60 if not "%JAVA_HOME%" == "" goto javahome61 23 62 :: Check if Java is on the search path63 echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat64 call setjava.bat65 del setjava.bat66 if not "%JAVAPATH%" == "" goto testJava67 68 :: Still haven't found anything, so try looking in the registry (gulp!)69 type nul > jdk.reg70 regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"71 type jdk.reg > jdk.txt72 del jdk.reg73 type nul > jre.reg74 regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"75 type jre.reg > jre.txt76 del jre.reg77 78 winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat79 del jdk.txt80 del jre.txt81 call setjava.bat82 del setjava.bat83 84 :: If nothing was found in the registry, we're stuck85 if "%JAVAPATH%" == "" goto noJava86 87 set JAVAPATH=%JAVAPATH%\bin88 goto testJava89 90 :javahome91 set JAVAPATH=%JAVA_HOME%\bin92 93 :testJava94 :: Check that a Java executable has been found95 if "%SERVERLANG%" == "en" echo Checking Java: %JAVAPATH%96 if "%SERVERLANG%" == "es" echo Revisando Java: %JAVAPATH%97 if "%SERVERLANG%" == "fr" echo Vârification de Java: %JAVAPATH%98 if "%SERVERLANG%" == "ru" echo Âà ®¢¥à ª Java: %JAVAPATH%99 if exist "%JAVAPATH%\java.exe" goto checkServer100 101 :noJava102 echo.103 if "%SERVERLANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a104 if "%SERVERLANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the105 if "%SERVERLANG%" == "en" echo Greenstone3 Server.106 goto exit107 108 :checkServer109 ::---- Check that the server program has been compiled ----110 if exist "server.jar" goto runServer111 if "%SERVERLANG%" == "en" echo "You need to compile the code before running the server"112 goto exit113 114 :runServer115 echo Running the Greenstone Server116 :: -Xms32M To set minimum memory117 :: -Xmx32M To set maximum memory118 :: -verbose:gc To set garbage collection messages119 :: -Xincgc For incremental garbage collection120 :: -Xprof Function call profiling121 :: -Xloggc:<file> Write garbage collection log122 123 "%JAVAPATH%\java" -cp "%CLASSPATH%" org.greenstone.server.Server "%GSDL3SRCHOME%"124 125 :exit126 127 :done128 :: ---- Clean up ----129 set JAVAPATH=130 24 131 25 -
greenstone3/trunk/gs3-server.sh
r13499 r14727 2 2 serverlang=en 3 3 4 echo5 4 echo "Greenstone 3 Server" 6 5 echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato" 7 6 echo "This software comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt" 8 7 echo "This is free software, and you are welcome to redistribute it" 9 echo10 8 11 9 ## -------- Run the Greenstone 3 Server -------- … … 14 12 thisdir=`pwd` 15 13 if [ ! -f "${thisdir}/gs3-server.sh" ]; then 16 if [ "$serverlang" == "es" ]; then 17 echo "Este guión deberá ejecutarse desde el directorio en el que reside." 18 elif [ "$serverlang" == "fr" ]; then 19 echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve." 20 elif [ "$serverlang" == "ru" ]; then 21 echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ" 22 else 23 echo "This script must be run from the directory in which it resides." 24 fi 14 echo "This script must be run from the directory in which it resides." 25 15 exit 1 26 16 fi 27 28 17 29 18 ## ---- Determine GSDL3SRCHOME ---- … … 31 20 32 21 # Some users may set the above line manually 33 if [ "x$gsdl3path" == "x" ]; then 34 # Check the environment variable first 35 if [ "x$GSDL3SRCHOME" != "x" ]; then 36 gsdl3path=$GSDL3SRCHOME 37 else 38 gsdl3path=`pwd` 39 fi 22 if [ -z "$gsdl3path" ]; then 23 gsdl3path=`pwd` 40 24 fi 41 25 42 # Setup Greenstone3, unless it has already been done 43 if [ "x$GSDL3SRCHOME" == "x" ]; then 44 pushd $gsdl3path > /dev/null 45 source gs3-setup.sh 46 popd > /dev/null 47 fi 48 49 ## ---- Check Java exists ---- 50 javapath= 51 52 # Some users may set the above line manually 53 if [ "x$javapath" = "x" ]; then 54 55 # If it is set, use the JAVA_HOME environment variable 56 if [ "x$JAVA_HOME" != "x" ]; then 57 javapath="$JAVA_HOME/bin/java" 58 59 # Check if Java is on the search path 60 else 61 javapath=`which java 2> /dev/null` 62 fi 63 fi 64 65 # Check that a Java executable has been found 66 if [ "$glilang" = "es" ]; then 67 echo "Revisando Java: $javapath" 68 elif [ "$glilang" = "fr" ]; then 69 echo "V<E9>rification de Java: $javapath" 70 elif [ "$glilang" = "ru" ]; then 71 echo "<F0><D2><CF><D7><C5><D2><CB><C1> Java: $javapath" 72 else 73 echo "Checking Java: $javapath" 74 fi 75 if [ ! -x "$javapath" ]; then 76 echo 77 echo "Failed to locate an appropriate version of Java. You must installa" 78 echo "Java Runtime Environment (version 1.4 or greater) before running the" 79 echo "Greenstone Server." 80 exit 1 81 fi 82 83 ## -- Check the version of Java is new enough (1.4.0 or higher) to run the Server -- do we need this? 84 #`$javapath -classpath . CheckJavaVersion > /dev/null` 85 #if [ $? -ne 2 ] ; then 86 # echo "The version of the Java Runtime Environment you have installed is too" 87 # echo "old to run the Greenstone Librarian Interface. Please install a new" 88 # echo "version of the JRE (version 1.4 or newer) and rerun this script." 89 #exit 1 90 #fi 91 92 ## ---- Check that the server has been compiled ---- 93 if [ ! -f server.jar ]; then 94 echo "You need to compile the server before running this script" 95 exit 1 26 if [ -z "$GSDL3SRCHOME" ]; then 27 # Setup Greenstone3, unless it has already been done 28 pushd $gsdl3path > /dev/null 29 source gs3-setup.sh 30 popd > /dev/null 96 31 fi 97 32 98 33 99 # Other arguments you can provide to java 100 # -Xms<number>M To set minimum memory (by default 32MB) 101 # -Xmx<number>M To set maximum memory (by default the nearest 2^n to the total remaining physical memory) 102 # -verbose:gc To set garbage collection messages 103 # -Xincgc For incremental garbage collection (significantly slows performance) 104 # -Xprof Function call profiling 105 # -Xloggc:<file> Write garbage collection log 34 # JRE_HOME or JAVA_HOME must be set correctly to run this program 35 if [ -n "$RUNJAVA" ]; then 36 "$RUNJAVA" -cp $CLASSPATH org.greenstone.server.Server $GSDL3SRCHOME 37 fi 106 38 107 java -cp $CLASSPATH org.greenstone.server.Server $GSDL3SRCHOME
Note:
See TracChangeset
for help on using the changeset viewer.