WildFly provides a service.bat
in %WILDFLY_HOME%\bin\service
. Calling the batch file with the install
parameter installs WildFly as a service on Windows.
I have made changes to the standalone.conf
and need to use the standalone-full.xml
in my setup. Hence, I would like to start the WildFly service with these parameters on Windows. Is it possible? How do I do it?
Yes, It is possible. You should only change SERVER_OPTS variable on standalone.bat file. In addition, you do not have to make changes on standalone.conf.
Put below line and try again.
set "SERVER_OPTS=--server-config=standalone-full.xml"
Just create the service with the command service.bat install /config standalone-full.xml
If you are using a Windows machine and have set Environment variable for Wildfly, goto command prompt and type the following command.
standalone.bat -c standalone-full.xml
This should start wildfly in the standalone-full configuration.
When running WildFly standalone server as a Windows service, service install
registers start command standalone.bat
with no option.
By default, standalone.bat
loads standalone.conf.bat
, and not standalone.conf
which is designed to Unix platforms.
It is possible to load a specific standalone.conf.bat
file setting environment variable STANDALONE_CONF
with its path. There, it is possible to set JAVA_OPTS
options but not server options.
To avoid to edit WildFly release standalone.bat
file, I recommend to create a copy of bin/service/service.bat
as bin/service/service-myproject.bat
where you can adapt start parameters and add --server-config
:
set STARTPARAM="/c \"set NOPAUSE=Y ^^^&^^^&
standalone.bat --server-config=standalone-full.xml\""
At the same time, this specific service-myproject.bat
allows you to tune your service installation with SHORTNAME
, DISPLAYNAME
and DESCRIPTION
variables.
Do not forget to invoke service-myproject.bat
with both /user
and /password
options so that the service is allowed to cleanly stop your instance with granted administrative user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With