For all who want to know ...
I didn't dare to use my first solution although it worked.
Our scenario was:
- start a java service
- we use JSL (Author: Michael Roeschter) to run the java app as a service
- JSL is configured to find the Java Machine by a environment variable.
We provide two installer packages (one with Java bundled, one without). That's why we use an environment variable. It points to our bundled Java either, or to another custom Java.
What's the problem now?
1. For the non-Java package, someone else must provide the environment variable prematurely => Not our problem
2. For the package with Java bundled, the problem comes up.
First solution:
- The environment variable pointing to Java was set by the Installer, and pointed to the bundled Java.
- The service was configured to use this freshly created variable. And it started successfully (but we don't trust.)
What we do now:
The package with Java bundled does configure the JSL without an environment variable. The Java path is hard coded in the configuration.
There are two disadvantages: the user cannot quickly change the JVM by modifing the environment variable. Further, our installer project is slightly more complicated.
Both are acceptable and we are done.
Nonetheless, I'll stay tuned for updates and further advices.
Ruben
FOLLOW US
Get the latest news in Application Packaging