setenv.bat
@echo off rem Licensed to the Apache Software Foundation (ASF) under one or more rem contributor license agreements. See the NOTICE file distributed with rem this work for additional information regarding copyright ownership. rem The ASF licenses this file to You under the Apache License, Version 2.0 rem (the "License"); you may not use this file except in compliance with rem the License. You may obtain a copy of the License at rem rem http://www.apache.org/licenses/LICENSE-2.0 rem rem Unless required by applicable law or agreed to in writing, software rem distributed under the License is distributed on an "AS IS" BASIS, rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. rem See the License for the specific language governing permissions and rem limitations under the License. rem --------------------------------------------------------------------------- rem Start/Stop Script for the CATALINA Server rem rem Environment Variable Prerequisites rem rem Do not set the variables in this script. Instead put them into a script rem setenv.bat in CATALINA_BASE/bin to keep your customizations separate. rem rem CATALINA_HOME May point at your Catalina "build" directory. rem rem CATALINA_BASE (Optional) Base directory for resolving dynamic portions rem of a Catalina installation. If not present, resolves to rem the same directory that CATALINA_HOME points to. rem rem CATALINA_OPTS (Optional) Java runtime options used when the "start", rem "run" or "debug" command is executed. rem Include here and not in JAVA_OPTS all options, that should rem only be used by Tomcat itself, not by the stop process, rem the version command etc. rem Examples are heap size, GC logging, JMX ports etc. rem rem CATALINA_TMPDIR (Optional) Directory path location of temporary directory rem the JVM should use (java.io.tmpdir). Defaults to rem %CATALINA_BASE%\temp. rem rem JAVA_HOME Must point at your Java Development Kit installation. rem Required to run the with the "debug" argument. rem rem JRE_HOME Must point at your Java Runtime installation. rem Defaults to JAVA_HOME if empty. If JRE_HOME and JAVA_HOME rem are both set, JRE_HOME is used. rem rem JAVA_OPTS (Optional) Java runtime options used when any command rem is executed. rem Include here and not in CATALINA_OPTS all options, that rem should be used by Tomcat and also by the stop process, rem the version command etc. rem Most options should go into CATALINA_OPTS. rem rem JAVA_ENDORSED_DIRS (Optional) Lists of of semi-colon separated directories rem containing some jars in order to allow replacement of APIs rem created outside of the JCP (i.e. DOM and SAX from W3C). rem It can also be used to update the XML parser implementation. rem Defaults to $CATALINA_HOME/endorsed. rem rem JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start" rem command is executed. The default is "dt_socket". rem rem JPDA_ADDRESS (Optional) Java runtime options used when the "jpda start" rem command is executed. The default is 8000. rem rem JPDA_SUSPEND (Optional) Java runtime options used when the "jpda start" rem command is executed. Specifies whether JVM should suspend rem execution immediately after startup. Default is "n". rem rem JPDA_OPTS (Optional) Java runtime options used when the "jpda start" rem command is executed. If used, JPDA_TRANSPORT, JPDA_ADDRESS, rem and JPDA_SUSPEND are ignored. Thus, all required jpda rem options MUST be specified. The default is: rem rem -agentlib:jdwp=transport=%JPDA_TRANSPORT%, rem address=%JPDA_ADDRESS%,server=y,suspend=%JPDA_SUSPEND% rem rem LOGGING_CONFIG (Optional) Override Tomcat's logging config file rem Example (all one line) rem set LOGGING_CONFIG="-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties" rem rem LOGGING_MANAGER (Optional) Override Tomcat's logging manager rem Example (all one line) rem set LOGGING_MANAGER="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" rem rem TITLE (Optional) Specify the title of Tomcat window. The default rem TITLE is Tomcat if it's not specified. rem Example (all one line) rem set TITLE=Tomcat.Cluster#1.Server#1 [%DATE% %TIME%] rem ---------------------------------------------------------------------------
catalina.bat 的注释
里面明确说道:不要把变量设置到catalina.bat 脚本,如果有需要把变量设置到setenv.bat
保证个性化的变量与tomcat 自有变量分离
setenv.bat 是被执行
实际应用
setenv.bat 内容如下:
set JAVA_OPTS=-noverify
linux shell script 是
JAVA_OPTS="-noverify"
设置这个是为了跳过 jibx 的一个验证而导致的错误