Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat 7 service.bat file is missing

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.

like image 377
Dave Avatar asked Apr 03 '13 21:04

Dave


People also ask

What is Startup bat in Tomcat?

For Windows users, these scripts are included as batch files, with the extension "bat". "Catalina" is the script that is actually responsible for starting Tomcat; the "startup" script simply runs "catalina" with the argument "start" ("catalina" also can be used with the "stop" parameter to shut down Tomcat).

Is Tomcat 7 still supported?

Tomcat 7 reached End-of-Support on 23 March 2021.

Where is Tomcat service located?

These programs are located in Tomcat's /bin/ directory. Tomcat6 is the actual service wrapper program that allows Tomcat to be run as a service, and will run entirely in the background after it has been installed, and accepts a long list of command line parameters that allow precise configuration of the Tomcat service.


2 Answers

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:

like image 150
informatik01 Avatar answered Oct 07 '22 16:10

informatik01


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

like image 27
ihebiheb Avatar answered Oct 07 '22 16:10

ihebiheb