I do not understand why that is required for Tomcat. All configuratios are in eg: /etc/tomcat7/server.xml
. I have worked for several years with Tomcat, but this kind of configuration I've never needed. Anyway here is your answer.
TL;DR
env "host.name=localhost"
Test with:
env "host.name=localhost" perl -le 'print $ENV{"host.name"}'
or with Java:
Create a runnable jar
package stackoverflow;
import java.util.Map;
public class PrintEnv {
public static void main(String[] args) {
Map<String, String> env = System.getenv();
for (String envName : env.keySet()) {
System.out.println(envName + ": " + env.get(envName));
}
}
}
and test with:
env "host.name=localhost" java -jar PrintEnv.jar | grep host.name