AS_JAVA ignored for start-domain?

116 views
Skip to first unread message

Markus Karg

unread,
Apr 20, 2021, 7:17:10 AM4/20/21
to Payara Forum
I noticed that (at least on Windows 10 using latest Payara Community Edition) when executing SET AS_JAVA=xxx followed by asadmin on the command line, then apparently asadmin itself is running on that particular JVM, while actually the particular command start-domain still uses the JVM located by JAVA_HOME instead. If I want start-domain to use AS_JAVA, then I must additionally add it into asenv.bat. I wonder why? Is that by intention? Is that a bug?

Markus Karg

unread,
Apr 22, 2021, 2:24:39 AM4/22/21
to Payara Forum
Payara team, can you please confirm that this behavior is intentional?

Rudy De Busscher

unread,
Apr 22, 2021, 11:07:15 AM4/22/21
to Payara Forum
Hi Markus,

I always used asenv.bat if I wanted to set a specific version for Payara.  Looking at the asenv.bat it seems the AS_JAVA should be picked up to start the domain. It might be the case that Windows 10 changed the behaviour of environment variables around .cmd and .bat.

Can you open a GitHub issue (https://github.com/payara/Payara/issues) describing the issue so that we can investigate this more?  Unless someone from the community has more insight on this (as I'm not a Windows users)

Best Regards
Rudy

Alexander Pinchuk

unread,
Apr 23, 2021, 2:46:34 AM4/23/21
to Payara Forum
Hi Markus,

This behavior are intentional.

When Payara Server starting by asadmin start-domain command, asenv.conf (asenv.bat on Windows) file parsed rather than read of the AS_JAVA variable from the environment. If asenv file does not contain AS_JAVA property,  the Payara will use domain.xml, JAVA_HOME env or some other source to find java executable. 

вторник, 20 апреля 2021 г. в 14:17:10 UTC+3, headcr...@googlemail.com:

Markus Karg

unread,
Apr 23, 2021, 3:24:40 AM4/23/21
to Payara Forum
Alexander, just because the script does that does not mean that this is wanted by the script author. They possibly just forgot to check if the variable exists already. That is why the vendor of this product already asked me to file an issue. :-)

Markus Karg

unread,
Apr 23, 2021, 3:35:15 AM4/23/21
to Payara Forum
Thank you, Rudy, for picking up this thread. As you proposed, I have opened a Github issue for the further investigation: https://github.com/payara/Payara/issues/5210. Thanks a lot! :-)
Reply all
Reply to author
Forward
0 new messages