Uploaded image for project: 'InsightEdge Platform'
  1. GS-13627

EXT_JAVA_OPTIONS environment variable is ignored when using OpenJDK with Microsoft Windows

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects versions: None
    • Fix versions: 14.0
    • Platform:
      All
    • SalesForce Case ID:
      12021
    • Workaround:
      Initialization of JAVA_OPTIONS for openJDK
    • Acceptance Test:
      None
    • Sprint:
      14.0.0-M14
    • Product:
      XAP
    • Edition:
      Open Source

      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%
      )

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: