groovy
  1. groovy
  2. GROOVY-4910

groovy.bat fails when the JAVA_OPTS contains space characters

    Details

    • Patch Submitted:
      Yes
    • Number of attachments :
      2

      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

        Activity

        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?
        Hide
        blackdrag blackdrag added a comment -

        Paul, can you check this?

        Show
        blackdrag blackdrag added a comment - Paul, can you check this?
        Hide
        Paul King added a comment -

        patch applied, thanks

        Show
        Paul King added a comment - patch applied, thanks

          People

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

            Dates

            • Created:
              Updated:
              Resolved: