title: What determines the current working directory of Tomcat Java process?
body: <p>My production server runs Linux using System V style init scripts.</p>
  
  <p>Tomcat is brought up by running <code>service tomcat6 start</code> as root user (<code>service</code> runs init script under cwd <code>/</code>).</p>
  
  <p>Tomcat then serves a web page to write the result of <code>new File(".").getAbsolutePath()</code>, which shows <code>/usr/share/tomcat6/.</code></p>
  
  <p>But Tomcat init script (<code>/etc/init.d/tomcat6</code>) makes no mention of CWD, neither does it have any <code>cd</code> command.</p>
  
  <p>Given that Java itself cannot change current working directory, then how come <code>/usr/share/tomcat6</code> became Tomcat's current working directory? Where in its startup process changes its cwd?</p>
  
  <p>The Linux in question is CentOS6.</p>