Max,
I do this myself all the time. (I am ccing the user list as this is
useful to
others as well) There are several ways to do this:
1) If your application is installed at C:\MyApp\, with its bin directory at
C:\MyApp\bin, then install the jre into a C:\MyApp\jre directory. Then
assuming that your Wrapper.exe file is located inside the C:\MyApp\bin,
you can simply set the following property:
wrapper.java.command=C:/MyApp/jre/bin/java
I would advise using relative paths in this case as it makes it possible for
the user to move the application around. Or at the least, simplifies your
installer:
wrapper.java.command=../jre/bin/java
2) Use an environment variable:
Define an environment variable, MY_JRE, then access the JRE's location
using the following property:
wrapper.java.command=%MY_JRE%/bin/java
In either case, I would define a template wrapper.conf file which contains
the following:
wrapper.java.command=${jre.dir}/bin/java
Then have your installer replace the "jre.dir" token with the actual
location of the JRE. The path can contain a mixture of forward and
backward slashes and the Wrapper will handle it correctly, so
wrapper.java.command=C:\MyApp\jre/bin/java
is ok.
Another option to modifying the wrapper.conf file is to declare the property
from the command line. So you would do the following when launching the
Wrapper.
Wrapper.exe -c ../conf/wrapper.conf
wrapper.java.command=C:/MyApp/jre/bin/java
If the path contains spaces, then include it in quotes:
Wrapper.exe -c ../conf/wrapper.conf
"wrapper.java.command=C:/MyApp/jre/bin/java"
Hope this helps,
Cheers,
Leif
Max Stolyarov wrote:
> Leif,
>
> I have an interesting situation here. I am trying to determine the
> dependence of Java Service Wrapper on the jre installed on the local
> machine. During the installation process my installer searches for a
> JRE package and if it cannot find it it installs a local version of
> jre that it uses by itself and which is not available to other
> programs to use because it does not modify registry settings or path
> or classpath on the local machine. So, my question is this: Is it
> possible to pass to a wrapper parameters that specify where my
> java.exe is located so that the wrapper can use it or do I have to
> have a full and proper JRE installation on the local machine in order
> for the wrapper to work? Thanks in advance.
>
> Max
>
|