groovy
  1. groovy
  2. GROOVY-5020

invoking groovy with -D seems to mess up main's args in some cases

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.8.2
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Ubuntu 11.04 amd64, 64-bit sun java

      java version "1.6.0_27"
      Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
      Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)
    • Number of attachments :
      0

      Description

      Put this code in A.groovy

      class A
      {
          public static void main(String[] args) {
      	args.each { println it }
          }
      }
      

      Run

      groovy -Da=b A.groovy -no-file
      

      Actual output:

      -n
      o-file
      

      Expected output:

      -no-file
      

      Omitting the -Da=b causes the arguments to be processed correctly. It appears that groovy's startup script is calling java correctly. In other words, running this command:

      /opt/jdk/bin/java -classpath /opt/groovy/lib/groovy-1.8.2.jar -Dscript.name=/opt/groovy/bin/groovy -Dprogram.name=groovy -Dgroovy.starter.conf=/opt/groovy/conf/groovy-starter.conf -Dgroovy.home=/opt/groovy -Dtools.jar=/opt/jdk/lib/tools.jar org.codehaus.groovy.tools.GroovyStarter --main groovy.ui.GroovyMain --conf /opt/groovy/conf/groovy-starter.conf --classpath . -Da=b A.groovy -no-file

      results in the same output.

        Issue Links

          Activity

          blackdrag blackdrag made changes -
          Field Original Value New Value
          Link This issue is related to GROOVY-5282 [ GROOVY-5282 ]
          blackdrag blackdrag made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Assignee blackdrag blackdrag [ blackdrag ]
          Resolution Won't Fix [ 2 ]
          Paul King made changes -
          Link This issue is related to GROOVY-5191 [ GROOVY-5191 ]

            People

            • Assignee:
              blackdrag blackdrag
              Reporter:
              Jay Berkenbilt
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: