I am trying to add an option to the JAVA_OPTS on a windows tomcat installed as a service.
- I can achieve that with using an out-of-box tomcat
- I can also achieve that with a tomcat service installation through using the gui which is tomcat7w.exe.
However, I need to do it non-interactively for automation purposes. I tried putting
SET JAVA_OPTS=%JAVA_OPTS% -javaagent:C:\MY_DIR
in setenv.bat and in catalina.bat under bin folder; it did not work. I also tried setting an environment variable 'JAVA_OPTS' and starting tomcat from a new terminal; still that did not work. Q: is there a way to specify JAVA_OPTS with tomcat service non-interactively (without gui)?