This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

How to set a system property?

Apr 20th, 2011, 07:56 AM

I am trying to set a system property on TC server 2.2.1

I tried to update the setenv.bat file in the bin directory of my instance but it didn't worked. The documentation is not very clear on that subject. I mainly use the "run" goal (i.e. run tc server as a foreground process).

If you start tc Server on Windows with run (or start), it'll run using the Java Service Wrapper. This means that VM configuration, including system properties, is defined in the wrapper.conf file rather than setenv.bat. System properties are set using wrapper.java.additional.n.

Comment

You can start tc Server using batch, i.e. tcruntime-ctl.bat instance-name batch. This'll start it as a foreground process without using the Java Service Wrapper. You can then use setenv.bat for its JVM configuration.

Comment

If you want to use the run goal: tcruntime-ctl.bat run just edit your $TC_SERVER$/conf/wrapper.conf and add extra system property to the wrapper.java.additional.XX (please make sure to follow the numbers. At the time of writing the latest value is 13 so you should add something like this

wrapper.java.additional.14="-DmySystemKey=myValue"

You can also patch your setenv.bat but in that case you must run the following command