Uploaded image for project: 'JITL - JobScheduler Integrated Template Library'
  1. JITL - JobScheduler Integrated Template Library
  2. JITL-721

GraalVM Scripting Interface should not require JAVA_HOME environment variable

    XMLWordPrintable

Details

    • Feature
    • Status: Released (View Workflow)
    • Medium
    • Resolution: Fixed
    • 2.5.4, 2.6.1
    • 2.5.6, 2.6.3
    • None

    Description

      Current Situation

      • The GraalVM Scripting Interface offers use of the Java and JavaScript languages for jobs.
      • The GraalVM Scripting Interface adds a number of settings to the scripting engine as visible from the attached pdJavascript.graalvm.options.jobresource.json file.
        • The settings include the path to the JVM that is used from the JAVA_HOME environment variable.
        • If no JAVA_HOME environment variable is specified then the settings will not be applied and GraalVM can raise the following error during startup of a job:
          javax.script.ScriptException: ReferenceError: require is not defined 
          
      • This forces users to specify the JAVA_HOME environment variable when running jobs.

      Desired Behavior

      • The GraalVM Scripting Interface should not require the JAVA_HOME environment variable.
      • Instead, the path to the JVM should used from
        System.getProperties().getProperty("java.home")
        

      Patch
      Patches are available for:

      Test instructions

      • Create a JavaScript job with an argument log_level=debug
      • Make sure that the JAVA_HOME environment variable is not set or that it points to an installation other than GraalVM
      • Check the JavaScript job output to find a debug line that starts with [getGraalJSScriptEngineOptions] and contains the GraalVM Java path

      Attachments

        Issue Links

          Activity

            People

              re Robert Ehrlich
              ap Andreas Püschel
              Pramokshi Narawariya Pramokshi Narawariya
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: