|
From: Leif M. <le...@ta...> - 2005-04-12 13:40:28
|
Eli,
The Wrapper's configuration file is able to expand system
environment variables
referenced in the configuration file. You can do so just as you mentioned:
wrapper.java.additional.1=-Djava.rmi.server.hostname=%COMPUTERNAME%
If the COMPUTERNAME environment variable is not defined then the string
will not be replaced.
The replacement syntax is the same of all platforms to make it
possible to reuse
the same configuration file across all platforms.
wrapper.java.command=%JAVA_HOME%\bin\java
Note that it is not possible to read environment variables from
within a JVM.
To make an environment variable visible to the JVM you must pass it in as a
system property:
wrapper.java.additional.2=-Denv.MYENV=%MYENV%
You then access it by calling System.getProperty( "env.MYENV" );
This is all described in the docs here:
http://wrapper.tanukisoftware.org/doc/english/props-envvars.html
Cheers,
Leif
Lev, Eli wrote:
>Hi,
>
>I'm using the simple wrapper way of doing things. One issue that I'm hitting is that one of the parameters that I need to feed the java app is the hostname of the machine where the app is running. So in the original dos bat that would launche tha app it's:
>
>start java -Djava.rmi.server.hostname%COMPUTERNAME%...
>
>So %COMPUTERNAME% is a system wide environment variable for windows that tells you the host that you're on (similar to unix's hostname command).
>
>In the wrapper.conf, I have the following:
>
>wrapper.java.additional.1=-Djava.rmi.server.hostname=???
>
>For the ??? - I place the hostname of the machine that I'm on and the service works fine. Can I put %COMPUTERNAME% for the wrapper.conf? In other words:
>wrapper.java.additional.1=-Djava.rmi.server.hostname=%COMPUTERNAME%
>
>Localhost is not an option in this case, and the problem is that this program will be installed on many different machines, so I'm trying to find a way of avoiding a dynamic creation of wrapper.conf during install.
>
>I'd appreciate any advice/feedback.
>
>Eli
>
>
|