New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug Report: AS_JAVA ignored for start-domain #5210
Comments
I think this is not a bug. This behavior is consistent with at least GlassFish 5 and GlassFish 6. |
That might be the case. But the question is whether the documented behavior is intentional, i. e. whether the authors of Payara do really want it to be this way, or whether they would say it might be beneficial to actually use the existing value of |
In Linux, the AS_JAVA variable is taken into account and Payara Server is started on the JVM specified by it. So it might be a bug on Windows or a limitation of environment variables on Windows. Unfortunately, I really don't think we can consider changing this in a foreseeable future as it's a rather edge case. If you find out how to fix it, feel free to raise a PR and we'll gladly accept it. Until then, I'll close this issue, I hope you understand. |
Actually, I realized that what you do isn't supported and it's not meant to be supported. To launch Payara Server with a JVM specified using AS_JAVA, the AS_JAVA variable needs to be specified in asenv.bat (or asenv.conf in Linux). This file is parsed for properties that are used to start the server. This is specified in the GlassFish documentation and Payara doesn't intend to change this. GlassFish Administration guide says: "For a valid JVM installation, locations are checked in the following order: a. domain.xml (java-home inside java-config) b. asenv.conf (setting AS_JAVA="path to java home")" It doesn't say anything about setting AS_JAVA as an environment variable. It's true that the asadmin script honours the AS_JAVA environment variable. This is an implementation detail. It just runs the asenv script, which sets the env variable and then the script uses it. But Payara Server launcher, which is started by this script, doesn't honour AS_JAVA env variable. Instead, it reads the asenv file as a text file and reads the variables from there: Line 264 in 91badcb
I'm sorry, but we're not going to change this in Payara Server. |
Description
I noticed that (at least on Windows 10 using latest Payara Community Edition) when executing
SET AS_JAVA=xxx
followed byasadmin
on the command line, then apparentlyasadmin
itself is running on that particular JVM, while actually the particular commandstart-domain
still uses the JVM located byJAVA_HOME
instead. If I wantstart-domain
to useAS_JAVA
, then I must additionally add it intoasenv.bat
.@rdebusscher asked me to file this issue in the Community forum.
Expected Outcome
start-domain
uses the JVM defined byAS_JAVA
already existing in environment before executingasadmin
.Current Outcome
asadmin
itself is running on the JVM found inAS_JAVA
in the environment before executingasadmin
, butstart-domain
still uses the JVM located byJAVA_HOME
insteadSteps to reproduce
AS_JAVA
inasenv.bat
.asadmin
will use<path-one>
butstart-domain
will use<path-two>
.Environment
The text was updated successfully, but these errors were encountered: