// shall I write some keywords here to boost search engine ranking?

Wednesday, September 03, 2008

Tomcat: Change console title on Windows

There are 2 ways of running Tomcat on Windows: run as service, run in console.

Although many will suggest to run as service for better performance, but run Tomcat in console have its advantages too. Especially when the web do not do proper file logging, but simply System.out.println.

When running Tomcat with conosle, the default title of the console is "Tomcat" or "Tomcat 5.0.x". It will be confusing if you running multiple Tomcat in same server.

In order to change the console title, below are the steps:
1) Open TOMCAT_HOME/bin/catalina.bat
2) Goto ":doStart" section
3) change the title at line of "set _EXECJAVA" which is 2 or 3 line after ":doStart":


:doStart
shift
if not "%OS%" == "Windows_NT" goto noTitle
set _EXECJAVA=start "Tomcat 5.0.28 (port 8080, AJP port 8009)" %_RUNJAVA%
By this small change, the title of the Tomcat console will changed to "Tomcat 5.0.28 (port 8080, AJP port 8009)" which is much more informative.

No comments: