source: trunk/gsdl3/gs3-setup.bat@ 13552

Last change on this file since 13552 was 13552, checked in by shaoqun, 17 years ago

add the current directory into the classpath

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
RevLine 
[6400]1@echo off
2
[6413]3if exist gs3-setup.bat goto start
[6400]4 echo This script must be run from within the Greenstone 3 home directory
5 goto exit
6
7:start
8:: ---- Set the GSDL3HOME variable to the current directory ----
[10646]9cd | winutil\setvar.exe GSDL3SRCHOME > setgsdl3.bat
[6400]10call setgsdl3.bat
11del setgsdl3.bat
[10646]12echo GSDL3SRCHOME: %GSDL3SRCHOME%
13set GSDL3HOME=%GSDL3SRCHOME%\web
[6400]14echo GSDL3HOME: %GSDL3HOME%
15
[13552]16set ANT_HOME=C:\shaoqunWu\apache-ant-1.7.0
17
[10646]18:: change if using external tomcat
[10824]19set TOMCAT_HOME=%GSDL3SRCHOME%\packages\tomcat
[10646]20
[6400]21:: ---- Set other important environment variables ----
22set GSDLOS=windows
[10646]23set PATH=%PATH%;%GSDL3SRCHOME%\bin;%GSDL3SRCHOME%\bin\script;%GSDL3SRCHOME%\lib\jni;%GSDL3SRCHOME%\packages\mysql\bin
[6400]24
25:: ---- Set the CLASSPATH environment variable ----
[13552]26set CLASSPATH=.;%GSDL3HOME%\WEB-INF\classes;%GSDL3SRCHOME\resources\java:%CLASSPATH%
[6400]27if exist setcp.bat del setcp.bat
[13233]28for %%j in ("%GSDL3SRCHOME%"\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> setcp.bat
[10734]29for %%j in ("%GSDL3HOME%"\WEB-INF\lib\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> setcp.bat
[10657]30for %%j in ("%GSDL3SRCHOME%"\lib\jni\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> setcp.bat
31for %%j in ("%TOMCAT_HOME%"\common\endorsed\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> setcp.bat
[10952]32for %%j in ("%GSDL3SRCHOME%"\build\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> setcp.bat
[10646]33
[6400]34call setcp.bat
35del setcp.bat
[10646]36
[6400]37echo CLASSPATH: %CLASSPATH%
38
[10646]39::cd %GSDL3HOME%
[6400]40
[6441]41:findJava
42:: ---- Check Java SDK exists ----
43set JAVAPATH=
44
45:: Some users may set the above line manually
46if not "%JAVAPATH%" == "" goto testJava
47
48 :: If it is set, use the JAVA_HOME environment variable
49 if not "%JAVA_HOME%" == "" goto exit
50
51 :: Look in the registry for Java SDK installations
52 type nul > jdk.reg
53 regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
54 type jdk.reg > jdk.txt
55 del jdk.reg
56
57 winutil\findjava.exe jdk.txt | winutil\setvar.exe JAVAPATH > setjava.bat
58 del jdk.txt
59 call setjava.bat
60 del setjava.bat
61
62 :: If a suitable installation was found in the registry, check it
63 if not "%JAVAPATH%" == "" goto testJava
64
65:noJava
66 echo.
67 echo Failed to locate an appropriate version of Java. You must install a
68 echo Java Development Kit (version 1.4 or greater) before running the
69 echo Greenstone 3 Digital Library Software.
70 pause
71 goto exit
72
73:testJava
74set JAVA_HOME=%JAVAPATH%
75
[6400]76:exit
Note: See TracBrowser for help on using the repository browser.