title: Can catalina.bat change environment variables?
body: <p>I am inheriting a project and (per the other developer's instructions) overwrote my Tomcat's version of <code>catalina.bat</code> with his (he's using the same version). I then tried to restart Tomcat and got an exception relating to the <code>commons-logging.jar</code>, which is a Tomcat dependency.</p>
  
  <p>After a lot of frustration, I just downloaded a different version of Tomcat and tried running it right out of the box (no configuration)...and I got the same error!</p>
  
  <p>So I asked <a href="https://stackoverflow.com/questions/9673716/tomcat-versions-arent-starting">this question</a> on SO a few days ago. The consensus was that my classpath had somehow gotten "dirty", and now I'm wondering if the <code>catalina.bat</code> file I blindly copied over somehow set environmental variables that is affecting Tomcat's ability to bootstrap - even across versions.</p>
  
  <p>I know this question is similar to the other one I asked but is different. Whereas my first question was "what's wrong here" and was much more general, what I am asking now (although related), is more specific and is about <code>catalina.bat</code> and how it relates to Windows 7 environment variables.</p>
  
  <p>Thanks for any help here.</p>
  
  <p><strong>Edit</strong>: I see this question already has a closevote for being "off topic". My argument against that is as follows: SO is a programming Q&amp;A site for asking specific questions related to code and programming. <code>catalina.bat</code> is a script, which is code, and this question concerns itself with a potential bug/defect in a script that I am using.</p>
  
  <p><strong>Edit</strong>: Found the line in <code>catalina.bat</code> where the error message is coming from (and, likewise, where Tomcat startup is dying from). It's is line (from 7.0.19's unchanged version):</p>
  
  <blockquote>
    <p>%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%</p>
  </blockquote>
  
  <p>I was able to place <code>echos</code> in the script and obtained the following values:</p>
  
  <pre><code>JAVA_OPTS = -Djava.util.logging.config.file="C:\Program Files\Apache\apache-to
  mcat-7.0.19\conf\logging.properties" -Djava.util.logging.manager=org.apache.juli
  .ClassLoaderLogManager
  CATALINA_OPTS =
  DEBUG_OPTS =
  JAVA_ENDORSED_DIRS = C:\Program Files\Apache\apache-tomcat-7.0.19\endorsed
  CLASSPATH = C:\Program Files\Apache\apache-tomcat-7.0.19\bin\bootstrap.jar
  CATALINA_BASE = C:\Program Files\Apache\apache-tomcat-7.0.19
  CATALINA_HOME = C:\Program Files\Apache\apache-tomcat-7.0.19
  CATALINA_TMPDIR = C:\Program Files\Apache\apache-tomcat-7.0.19\temp
  MAINCLASS is org.apache.catalina.startup.Bootstrap
  CMD_LINE_ARGS =
  ACTION = start
  </code></pre>
  
  <p>JAVA_OPTS has my full attention with the <code>logging.properties</code> and <code>ClassLoaderLogManager</code> entries. Does this mean <em>anything</em> to anyone?!?</p>