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.
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: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:
Therefore you can download the "64-bit Windows zip" and unpack it.
The
Tomcat10.exe
executable in thebin
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 theservice.bat
script in the same folder: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:some parameters can be provided through environment variables:
CATALINA_HOME
,CATALINA_BASE
,JAVA_HOME
andJRE_HOME
,JAVA_ENDORSED_DIRS
to set thejava.endorsed.dirs
system property,SERVICE_STARTUP_MODE
to choose the service's startup mode betweenmanual
(default),delayed
orauto
,JvmMs
to set the initial memory pool size in MiB (default 128),JvmMx
to set the maximum memory pool size in MiB (default 256).