I am running Tomcat 8.5.61 on Java 8 and need to provide a system property for my application. Locally, I am on Windows and run Tomcat from Git Bash.
The most obvious approach I found is to set it in setenv.sh
like this:
CATALINA_OPTS="$CATALINA_OPTS -Dsome.variable=/value/"
The value for my property needs to be set with the slashes.
However, during startup, I see the following log, and the value observed by the application is as shown here, which fails the application:
26-Mar-2021 09:00:29.955 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dsome.variable=C:/Program Files/Git/value/
Seems that somehow the value was changed to be a folder below the Git home folder. (That folder was maybe chosen because I started Tomcat from Git Bash?)
I did not find online any hint regarding this behaviour so far. How can it be explained, and how should I set my system property instead?