Groovy
  1. Groovy
  2. GROOVY-4910

groovy.bat fails when the JAVA_OPTS contains space characters

    Details

    • Flags:
      Patch

      Description

      groovy.bat fails when the JAVA_OPTS environment variable contains space characters like the following:

      > set JAVA_OPTS=-Daprop="a value"
      > bin\groovy -h
      value"" was unexpected at this time.

      1. patch
        2 kB
        Masato Nagai
      2. test.groovy4910.bat
        0.6 kB
        Masato Nagai

        Issue Links

          Activity

          Masato Nagai created issue -
          Hide
          Masato Nagai added a comment -

          >contains space characters
          contains double quoted strings have space characters

          Show
          Masato Nagai added a comment - >contains space characters contains double quoted strings have space characters
          Hide
          Masato Nagai added a comment -

          When JAVA_OPTS is -Daprop="a value", "%JAVA_OPTS" means "-Daprop="a value"".
          So the following part of startGroovy.bat (line 223) throws the error.

          if "%JAVA_OPTS%" == "" set JAVA_OPTS="-Xmx128m"

          The patch changes startGroovy.bat to use GROOVY_OPTS local variable for local options instead of JAVA_OPTS that is commonly used by other programs.

          Show
          Masato Nagai added a comment - When JAVA_OPTS is -Daprop="a value", "%JAVA_OPTS" means "-Daprop="a value"". So the following part of startGroovy.bat (line 223) throws the error. if "%JAVA_OPTS%" == "" set JAVA_OPTS="-Xmx128m" The patch changes startGroovy.bat to use GROOVY_OPTS local variable for local options instead of JAVA_OPTS that is commonly used by other programs.
          Hide
          Masato Nagai added a comment -

          I also attached a small test program.
          By the way, is there nobody can verify this issue?

          Show
          Masato Nagai added a comment - I also attached a small test program. By the way, is there nobody can verify this issue?
          Masato Nagai made changes -
          Field Original Value New Value
          Attachment test.groovy4910.bat [ 55851 ]
          Hide
          Jochen Theodorou added a comment -

          Paul, can you check this?

          Show
          Jochen Theodorou added a comment - Paul, can you check this?
          Jochen Theodorou made changes -
          Assignee Paul King [ paulk ]
          Paul King made changes -
          Component/s command line processing [ 10445 ]
          Hide
          Paul King added a comment -

          patch applied, thanks

          Show
          Paul King added a comment - patch applied, thanks
          Paul King made changes -
          Fix Version/s 1.9-beta-2 [ 17494 ]
          Fix Version/s 1.8.2 [ 17495 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Paul King made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
          Mark Thomas made changes -
          Workflow jira [ 12733837 ] Default workflow, editable Closed status [ 12745485 ]
          Mark Thomas made changes -
          Flags Patch [ 10430 ]
          Patch Submitted Yes [ 10763 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
          Mark Thomas made changes -
          Workflow jira [ 12970083 ] Default workflow, editable Closed status [ 12977844 ]
          Jeffrey Adamson made changes -
          Link This issue is related to GROOVY-7378 [ GROOVY-7378 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          24d 17h 40m 1 Paul King 27/Jul/11 00:44
          Resolved Resolved Closed Closed
          42d 14h 28m 1 Paul King 07/Sep/11 15:13

            People

            • Assignee:
              Paul King
              Reporter:
              Masato Nagai
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development