Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass a system property using Wrapper.exe

How do I pass a property to a Java process, started as a Windows service using Wrapper.exe?

The target code calls:

System.getProperty("ADMIN_USERNAME");
like image 958
parkr Avatar asked Mar 09 '09 04:03

parkr


1 Answers

http://wrapper.tanukisoftware.org/doc/english/prop-java-additional-n.html

You can set "additional parameters" that will go to the JVM (as opposed to your main class), and -DADMIN_USERNAME=gandalf should work there.

wrapper.java.additional.1=-Xrs
wrapper.java.additional.2=-Dprop=TRUE
wrapper.java.additional.3=-DADMIN_USERNAME=gandalf

Update: You must start with additional.1 and count up without gaps (This is a convention for shoe-horning lists into Java properties syntax).

like image 131
Thilo Avatar answered Sep 27 '22 17:09

Thilo