|
From: Leif M. <le...@ta...> - 2003-02-01 04:01:03
|
Mikkel,
Thanks for your work here. But I think there are already a couple
ways to handle
this. :-)
To set an environment variable on Windows or Unix, the typical
method is to
simply set the variable in the script file used to launch the Wrapper.
Something
like this:
---
set JAVA_HOME=C:\devtools\jdk1.4.1
set PROJECT_HOME=c:\myproject\sompath
wrapper.exe -i c:\myproject\somepath\conf\wrapper.conf
---
If you only need to see the environment variables from within Java, then
a second way of doing this is to either set the variables in the
wrapper.conf
file:
---
wrapper.java.additional.1=-DJAVA_JOME=C:\devtools\jdk1.4.1
wrapper.java.additional.2=-DPROJECT_HOME=c:\myproject\sompath
---
Or you can do the same thing from the command line, if that is what you
prefer: (All one line )
---
wrapper.exe -i c:\myproject\somepath\conf\wrapper.conf
wrapper.java.additional.1=-DJAVA_JOME=C:\devtools\jdk1.4.1
wrapper.java.additional.2=-DPROJECT_HOME=c:\myproject\sompath
---
What version of Windows are using? In the NT based windows
versions (2000, XP) You simply have to open up a new command
prompt after changing system wide environment variables. Existing
command prompts will be unaffected.
Cheers,
Leif
Mikkel Damsgaard wrote:
> I hacked the wrapper_win.c code to add support for a -d option, to define
> additional environment variable on the command line to wrapper.
>
> ie:
>
> wrapper -i c:\myproject\somepath\conf\wrapper.conf wrapper.debug=true
> -d:PROJECT_HOME=c:\myproject\sompath -d:JAVA_HOME=C:\devtools\jdk1.4.1
>
> where the order of arguments after the config file is irrelevant.
>
> The main reason for this is that when developing under windows I have
> to reboot the machine before the services "sees" changes in
> environment variables
> and it is much more convenient to specify it at the command line to
> wrapper.
>
> Futhermore I have several similar services running and it is nice to
> be able to change
> behaviour based on variables set on the commandline.
>
> What do you think?
>
> /Mikkel
>
> Attached: modified version of wrapper_win.c and also Makefile.win32
>
|