Apache Tomcat 10.0 Silent Installation

1.9k views Asked by At

Does anyone know how to install Apache Tomcat 10 silently on the commandline?

I have tried /S and it just doesn't work. It seems like nothing is running and I get no error, it just goes directly to another command prompt.

Without any arguments the installer comes up properly.

I want everything installed as default except for the windows service to be set to auto instead of manual.

1

There are 1 answers

16
Piotr P. Karwasz On BEST ANSWER

Installation using the Windows installer

Tomcat's Windows installer is an NSIS installer, therefore it supports the standard /S command switch.

All other standard NSIS options also work, so if your want to install it in another folder, just execute in a cmd prompt:

tomcat-<version>.exe /S /D=D:\installation path\with spaces

The only non standard command line options are:

  • /? which prints a nice usage message,
  • /C=config.ini, which allows to set other variables in an *.ini file. The complete list of variables you can set can be found in the source script.

Installation from zip archive

Tomcat installation sums up to:

  • unpacking the files in a directory,
  • installing the service.

Therefore you can download the "64-bit Windows zip" and unpack it.

The Tomcat10.exe executable in the bin folder is the executable used to install the service and it is actually a copy of prunsrv. You can find the list of command line parameters in its documentation.

Instead of calling directly prunsrv, it is easier to use the service.bat script in the same folder:

set "SERVICE_STARTUP_MODE=auto"
service.bat install

There is no "silent" switch, but all the output is done by the script itself, so you can comment it out.

Edit: Although the service.bat script has only a couple of arguments available:

service.bat install/remove [service_name [--rename]] [--user username]

some parameters can be provided through environment variables:

  • the standard CATALINA_HOME, CATALINA_BASE, JAVA_HOME and JRE_HOME,
  • the obsolete JAVA_ENDORSED_DIRS to set the java.endorsed.dirs system property,
  • SERVICE_STARTUP_MODE to choose the service's startup mode between manual (default), delayed or auto,
  • JvmMs to set the initial memory pool size in MiB (default 128),
  • JvmMx to set the maximum memory pool size in MiB (default 256).