17

I like to use command line to install Tomcat as a Windows service. There should be the service.bat file for this purpose. But it is missing from Tomcat 7.0.37 and 7.0.39. We can not use Windows installer for embedded, so this is not an option.

Thanks for help.

0

2 Answers 2

14

Are you sure you have downloaded the right package?

From the download page for the latest Tomcat 7 version (7.0.39 at the moment of writing this) choose depending on your needs:

  • 32-bit Windows zip
  • 64-bit Windows zip

Both packages have service.bat in the bin directory.

Also on the download page read the README file for packaging information. It explains what every distribution contains.


UPDATE

From the README file for packaging information (emphasis mine):

apache-tomcat-[version].zip or .tar.gz
       Base distribution. These distributions do not include the Windows service wrapper nor the compiled APR/native library for Windows.

apache-tomcat-[version]-windows-x86.zip
       32-bit Windows specific distribution that includes the Windows service wrapper and the compiled APR/native library for use with 32-bit JVMs on both 32 and 64 bit Windows platforms.

apache-tomcat-[version]-windows-x64.zip
       64-bit Windows specific distribution that includes the Windows service wrapper and the compiled APR/native library for use with 64-bit JVMs on x64 Windows platforms.


You may also find it useful reading the RUNNING.txt file, which is available in every distribution. It contains important details about installing/configuring/running Apache Tomcat and also Windows and *nix specific instructions.

Tomcat is a Java application. So it is cross-platform. But if you want/need to utilize Windows specific features, like Windows services in your case, then you should download the Windows specific distribution.


Other thoughts

I myself on my Windows machine use "Base distribution" (i.e. not Windows specific, but an ordinary ZIP file available on the download page under Binary Distributions => Core) without any problem whatsoever, because I prefer not to bother with installations (i.e. running the installer), but just to simply unpack the distribution to the desired directory and manually configure it using the related config files. It's so much easier and convenient both to install (just unpack) and delete the installation (just delete without running any uninstaller), and it's more portable. Plus this way you can install multiple versions of Tomcat on the same machine (in case you need this for some development/testing reasons).

Here is a very useful step-by-step tutorial with some nice illustrations and explanations:

2
  • I downloaded cross-platform one: apache-tomcat-7.0.39.zip. It does not have it under bin. what is the difference than xxxx-windows-x86/64.zip Thanks.
    – Dave
    Commented Apr 8, 2013 at 0:27
  • Running tomcat as a service on Windows does not prevent you from running multiple instances of tomcat. The service how to describes how to do this tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html
    – simon
    Commented Feb 28, 2016 at 17:39
10

In the official web site, under core. Don't download the version tagged zip. Download the version tagged 32-bit Windows zip or 64-bit Windows zip. You will find Service.bat under Bin

3
  • 2
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.
    – Peter Foti
    Commented Jan 3, 2015 at 19:39
  • 1
    @PeterFoti, I don't think including the contents of that service.bat would do any good in this case :)
    – fejese
    Commented Jan 3, 2015 at 20:22
  • This answer should be the correct one, i had the same issue because i didn't download the right zip
    – Katzura
    Commented Nov 22, 2021 at 8:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.