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

Last change on this file since 13552 was 13552, checked in by shaoqun, 15 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
Line 
1@echo off
2
3if exist gs3-setup.bat goto start
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 ----
9cd | winutil\setvar.exe GSDL3SRCHOME > setgsdl3.bat
10call setgsdl3.bat
11del setgsdl3.bat
12echo GSDL3SRCHOME: %GSDL3SRCHOME%
13set GSDL3HOME=%GSDL3SRCHOME%\web
14echo GSDL3HOME: %GSDL3HOME%
15
16set ANT_HOME=C:\shaoqunWu\apache-ant-1.7.0
17
18:: change if using external tomcat
19set TOMCAT_HOME=%GSDL3SRCHOME%\packages\tomcat
20
21:: ---- Set other important environment variables ----
22set GSDLOS=windows
23set PATH=%PATH%;%GSDL3SRCHOME%\bin;%GSDL3SRCHOME%\bin\script;%GSDL3SRCHOME%\lib\jni;%GSDL3SRCHOME%\packages\mysql\bin
24
25:: ---- Set the CLASSPATH environment variable ----
26set CLASSPATH=.;%GSDL3HOME%\WEB-INF\classes;%GSDL3SRCHOME\resources\java:%CLASSPATH%
27if exist setcp.bat del setcp.bat
28for %%j in ("%GSDL3SRCHOME%"\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> setcp.bat
29for %%j in ("%GSDL3HOME%"\WEB-INF\lib\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> setcp.bat
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
32for %%j in ("%GSDL3SRCHOME%"\build\*.jar) do echo set CLASSPATH=%%CLASSPATH%%;%%j>> setcp.bat
33
34call setcp.bat
35del setcp.bat
36
37echo CLASSPATH: %CLASSPATH%
38
39::cd %GSDL3HOME%
40
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
76:exit
Note: See TracBrowser for help on using the repository browser.