blob: 7b888359abc6fdf8e423463579837730bf872a74 [file] [log] [blame]
Hongqing Liufd5ee812014-05-10 16:32:51 +08001@echo off
2rem Licensed to the Apache Software Foundation (ASF) under one or more
3rem contributor license agreements. See the NOTICE file distributed with
4rem this work for additional information regarding copyright ownership.
5rem The ASF licenses this file to You under the Apache License, Version 2.0
6rem (the "License"); you may not use this file except in compliance with
7rem the License. You may obtain a copy of the License at
8rem
9rem http://www.apache.org/licenses/LICENSE-2.0
10rem
11rem Unless required by applicable law or agreed to in writing, software
12rem distributed under the License is distributed on an "AS IS" BASIS,
13rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14rem See the License for the specific language governing permissions and
15rem limitations under the License.
16
17if "%OS%" == "Windows_NT" setlocal
18rem ---------------------------------------------------------------------------
19rem Wrapper script for command line tools
20rem
21rem Environment Variable Prerequisites
22rem
23rem CATALINA_HOME May point at your Catalina "build" directory.
24rem
25rem TOOL_OPTS (Optional) Java runtime options used when the "start",
26rem "stop", or "run" command is executed.
27rem
28rem JAVA_HOME Must point at your Java Development Kit installation.
29rem
30rem JAVA_OPTS (Optional) Java runtime options used when the "start",
31rem "stop", or "run" command is executed.
32rem ---------------------------------------------------------------------------
33
34rem Guess CATALINA_HOME if not defined
35if not "%CATALINA_HOME%" == "" goto gotHome
36set CATALINA_HOME=.
37if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto okHome
38set CATALINA_HOME=..
39:gotHome
40if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto okHome
41echo The CATALINA_HOME environment variable is not defined correctly
42echo This environment variable is needed to run this program
43goto end
44:okHome
45
46rem Ensure that any user defined CLASSPATH variables are not used on startup,
47rem but allow them to be specified in setenv.bat, in rare case when it is needed.
48set CLASSPATH=
49
50rem Get standard environment variables
51if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
52
53rem Get standard Java environment variables
54if exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspath
55echo Cannot find "%CATALINA_HOME%\bin\setclasspath.bat"
56echo This file is needed to run this program
57goto end
58:okSetclasspath
59set "BASEDIR=%CATALINA_HOME%"
60call "%CATALINA_HOME%\bin\setclasspath.bat"
61
62rem Add on extra jar files to CLASSPATH
63rem Note that there are no quotes as we do not want to introduce random
64rem quotes into the CLASSPATH
65if "%CLASSPATH%" == "" goto noclasspath
66set "CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar;%BASEDIR%\lib\servlet-api.jar"
67goto okclasspath
68:noclasspath
69set "CLASSPATH=%CATALINA_HOME%\bin\bootstrap.jar;%BASEDIR%\lib\servlet-api.jar"
70:okclasspath
71
72rem Get remaining unshifted command line arguments and save them in the
73set CMD_LINE_ARGS=
74:setArgs
75if ""%1""=="""" goto doneSetArgs
76set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
77shift
78goto setArgs
79:doneSetArgs
80
81%_RUNJAVA% %JAVA_OPTS% %TOOL_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.home="%CATALINA_HOME%" org.apache.catalina.startup.Tool %CMD_LINE_ARGS%
82
83:end