Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 771 | blopes | 1 | @echo off |
| 2 | rem Licensed to the Apache Software Foundation (ASF) under one or more |
||
| 3 | rem contributor license agreements. See the NOTICE file distributed with |
||
| 4 | rem this work for additional information regarding copyright ownership. |
||
| 5 | rem The ASF licenses this file to You under the Apache License, Version 2.0 |
||
| 6 | rem (the "License"); you may not use this file except in compliance with |
||
| 7 | rem the License. You may obtain a copy of the License at |
||
| 8 | rem |
||
| 9 | rem http://www.apache.org/licenses/LICENSE-2.0 |
||
| 10 | rem |
||
| 11 | rem Unless required by applicable law or agreed to in writing, software |
||
| 12 | rem distributed under the License is distributed on an "AS IS" BASIS, |
||
| 13 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||
| 14 | rem See the License for the specific language governing permissions and |
||
| 15 | rem limitations under the License. |
||
| 16 | |||
| 17 | rem --------------------------------------------------------------------------- |
||
| 18 | rem Wrapper script for command line tools |
||
| 19 | rem |
||
| 20 | rem Environment Variable Prerequisites |
||
| 21 | rem |
||
| 22 | rem CATALINA_HOME May point at your Catalina "build" directory. |
||
| 23 | rem |
||
| 24 | rem TOOL_OPTS (Optional) Java runtime options. |
||
| 25 | rem |
||
| 26 | rem JAVA_HOME Must point at your Java Development Kit installation. |
||
| 27 | rem Using JRE_HOME instead works as well. |
||
| 28 | rem |
||
| 29 | rem JRE_HOME Must point at your Java Runtime installation. |
||
| 30 | rem Defaults to JAVA_HOME if empty. If JRE_HOME and JAVA_HOME |
||
| 31 | rem are both set, JRE_HOME is used. |
||
| 32 | rem |
||
| 33 | rem JAVA_OPTS (Optional) Java runtime options. |
||
| 34 | rem |
||
| 35 | rem JAVA_ENDORSED_DIRS (Optional) Lists of of semi-colon separated directories |
||
| 36 | rem containing some jars in order to allow replacement of APIs |
||
| 37 | rem created outside of the JCP (i.e. DOM and SAX from W3C). |
||
| 38 | rem It can also be used to update the XML parser implementation. |
||
| 39 | rem This is only supported for Java <= 8. |
||
| 40 | rem Defaults to $CATALINA_HOME/endorsed. |
||
| 41 | rem --------------------------------------------------------------------------- |
||
| 42 | |||
| 43 | setlocal |
||
| 44 | |||
| 45 | rem Guess CATALINA_HOME if not defined |
||
| 46 | set "CURRENT_DIR=%cd%" |
||
| 47 | if not "%CATALINA_HOME%" == "" goto gotHome |
||
| 48 | set "CATALINA_HOME=%CURRENT_DIR%" |
||
| 49 | if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto okHome |
||
| 50 | cd .. |
||
| 51 | set "CATALINA_HOME=%cd%" |
||
| 52 | cd "%CURRENT_DIR%" |
||
| 53 | :gotHome |
||
| 54 | if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto okHome |
||
| 55 | echo The CATALINA_HOME environment variable is not defined correctly |
||
| 56 | echo This environment variable is needed to run this program |
||
| 57 | goto end |
||
| 58 | :okHome |
||
| 59 | |||
| 60 | rem Ensure that any user defined CLASSPATH variables are not used on startup, |
||
| 61 | rem but allow them to be specified in setenv.bat, in rare case when it is needed. |
||
| 62 | set CLASSPATH= |
||
| 63 | |||
| 64 | rem Get standard environment variables |
||
| 65 | if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat" |
||
| 66 | |||
| 67 | rem Get standard Java environment variables |
||
| 68 | if exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspath |
||
| 69 | echo Cannot find "%CATALINA_HOME%\bin\setclasspath.bat" |
||
| 70 | echo This file is needed to run this program |
||
| 71 | goto end |
||
| 72 | :okSetclasspath |
||
| 73 | call "%CATALINA_HOME%\bin\setclasspath.bat" %1 |
||
| 74 | if errorlevel 1 goto end |
||
| 75 | |||
| 76 | rem Add on extra jar files to CLASSPATH |
||
| 77 | rem Note that there are no quotes as we do not want to introduce random |
||
| 78 | rem quotes into the CLASSPATH |
||
| 79 | if "%CLASSPATH%" == "" goto emptyClasspath |
||
| 80 | set "CLASSPATH=%CLASSPATH%;" |
||
| 81 | :emptyClasspath |
||
| 82 | set "CLASSPATH=%CLASSPATH%%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_HOME%\bin\tomcat-juli.jar;%CATALINA_HOME%\lib\servlet-api.jar;%CATALINA_HOME%\lib\tomcat-util.jar" |
||
| 83 | |||
| 84 | set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager |
||
| 85 | |||
| 86 | rem Java 9 no longer supports the java.endorsed.dirs |
||
| 87 | rem system property. Only try to use it if |
||
| 88 | rem JAVA_ENDORSED_DIRS was explicitly set |
||
| 89 | rem or CATALINA_HOME/endorsed exists. |
||
| 90 | set ENDORSED_PROP=ignore.endorsed.dirs |
||
| 91 | if "%JAVA_ENDORSED_DIRS%" == "" goto noEndorsedVar |
||
| 92 | set ENDORSED_PROP=java.endorsed.dirs |
||
| 93 | goto doneEndorsed |
||
| 94 | :noEndorsedVar |
||
| 95 | if not exist "%CATALINA_HOME%\endorsed" goto doneEndorsed |
||
| 96 | set ENDORSED_PROP=java.endorsed.dirs |
||
| 97 | :doneEndorsed |
||
| 98 | |||
| 99 | rem Get remaining unshifted command line arguments and save them in the |
||
| 100 | set CMD_LINE_ARGS= |
||
| 101 | :setArgs |
||
| 102 | if ""%1""=="""" goto doneSetArgs |
||
| 103 | set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 |
||
| 104 | shift |
||
| 105 | goto setArgs |
||
| 106 | :doneSetArgs |
||
| 107 | |||
| 108 | "%_RUNJAVA%" %JAVA_OPTS% %TOOL_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.home="%CATALINA_HOME%" org.apache.catalina.startup.Tool %CMD_LINE_ARGS% |
||
| 109 | |||
| 110 | :end |