blob: 179e245242a6e70fc7c45294c24602ebd7ac97f4 [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 Start script for the CATALINA Server
20rem ---------------------------------------------------------------------------
21
22rem Guess CATALINA_HOME if not defined
23set "CURRENT_DIR=%cd%"
24if not "%CATALINA_HOME%" == "" goto gotHome
25set "CATALINA_HOME=%CURRENT_DIR%"
26if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
27cd ..
28set "CATALINA_HOME=%cd%"
29cd "%CURRENT_DIR%"
30:gotHome
31if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
32echo The CATALINA_HOME environment variable is not defined correctly
33echo This environment variable is needed to run this program
34goto end
35:okHome
36
37set "EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat"
38
39rem Check that target executable exists
40if exist "%EXECUTABLE%" goto okExec
41echo Cannot find "%EXECUTABLE%"
42echo This file is needed to run this program
43goto end
44:okExec
45
46rem Get remaining unshifted command line arguments and save them in the
47set CMD_LINE_ARGS=
48:setArgs
49if ""%1""=="""" goto doneSetArgs
50set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
51shift
52goto setArgs
53:doneSetArgs
54
55call "%EXECUTABLE%" start %CMD_LINE_ARGS%
56
57:end