EXT_JAVA_OPTIONS environment variable is ignored when using OpenJDK with Microsoft Windows

Description

set JAVA_HOME to a JVM directory that is not Oracle JDK. (ex. https://www.azul.com/downloads/zulu/)

  • define additional options in EXT_JAVA_OPTIONS, ex. -Dcom.gs.transport_protocol.lrmi.bind-port=11000-13000"

  • start gs-agent.bat

  • check the JVM startup options with jconsole

==> values defined EXT_JAVA_OPTIONS are not there

Problem is:
FOR /F "tokens=*" %%i IN ('%JAVACMD% -cp xap-datagrid.jar com.gigaspaces.internal.utils.OutputJVMOptions') DO set JAVA_OPTIONS=%%i %EXT_JAVA_OPTIONS%
This lines takes the output of OutputJVMOptions and combines it with EXT_JAVA_OPTIONS to define JAVA_OPTIONS which is later used to start the target Java process (GSA, GSM, GSC, ...)

Unfortunately this only works if OutputJVMOptions returns any value. However, checking the source code this is only the case for the JVMs where system property "java.vm.name" contains either the text "HOTSPOT" or "J9", which is not the case for OpenJDK.

We solved this by adding these lines to the setenv.bat file

IF NOT DEFINED JAVA_OPTIONS (
SET JAVA_OPTIONS=%EXT_JAVA_OPTIONS%
)

Workaround

Initialization of JAVA_OPTIONS for openJDK

Acceptance Test

None

Status

Assignee

Elad Gur

Reporter

Ester Atzmon

Priority

Medium

SalesForce Case ID

12021

Fix versions

Commitment Version/s

None

Due date

None

Product

XAP

Edition

Open Source

Platform

All

Sprint

None