December 18th, 2009
8:10 pm
Tomcat as a service under Windows 7 64 Bit / 32 bit JVM

Posted under Tomcat
Tags , ,

See the Tomcat 6 Download Page

If you use the Windows service installer (self installing Exe) to install Tomcat 6.0.24 under Windows 7 64 bit, it insists on a 64 bit JVM. I am using a 32 bit JVM and if you try to use that, Tomcat will not start.

You can do this by using the 32 bit Windows zip version, which still allows you to run Tomcat as a service. It also allows you access to the Tomcat Configuration/Monitor utility which you can also run in the System Tray, but you have to set this up manually.

The following steps will do this install :-

1/ Download the 32 bit Zip installation above, and unzip to the desired target installation location.

2/ Edit <Tomcat Home>\conf\server.xml to change the default http port from 8080 if required

3/ Edit  <Tomcat Home>\conf\tomcat-users.xml to add an admin user if desired, by inserting the following in the <tomcat-users> section :-

<role rolename=”manager”/>
<role rolename=”admin”/>
<user name=”admin” password=”mypassword” roles=”manager,admin”/>

4/ Issue the command Service install from an administrator privileged command window pointing at the <Tomcat Home>\bin directory.

5/ Create the following shortcuts to run the Tomcat Configuration Utility and the System Tray Monitor Utility.
Substitute your device and directory for <Tomcat Home>.

Configuration Utility – Target “<Tomcat Home>\bin\tomcat6w.exe”  //ES//Tomcat6
System Tray Monitor – Target:  “<Tomcat Home>\bin\tomcat6w.exe”  //MS//Tomcat6
(Both Cases) – Start In: may be left blank
(Both cases) – Tick the Run as Administrator check box under either the Shortcut or compatibility tab.

6/ Note that you will have to OK running as administrator each time you run one of the shortcuts, assuming you have User Account Control turned on in Windows 7. This is also true if you try to run the tray monitor automatically in the startup group. Windows 7 insists that each time you log in, you have to OK the administrator usage(!) This is supposed to happen by adding such autostarted tray applications to a “blocked startup” group which have a tray icon to display and then selectively “OK” them to unblock them/OK the administrator usage. This never worked for me – anything I placed in the startup folder which needed administrator access just plain did not run at all, and I never saw this “blocked” icon. As it would mean OKing at each login anyway, it seemed to me that there is no point trying to autostart tray icons that need administrator access as it was more hassle to unblock them (even if it did work) rather than just run them as needed from the super bar or quick launch bar (and of course OK them).

No Comments »

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.